-
Hello,
Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
As I am using OLLAMA, I tried to see what's the context length and this is what I found
|
Beta Was this translation helpful? Give feedback.
-
As per ollama docs
|
Beta Was this translation helpful? Give feedback.
-
Interesting, it seems like ollama doesn't error out and just truncates the input without throwing an exception like other model providers. Here is an ollama issue other folks raised: ollama/ollama#4967 To get around this, I would run the tokenizer on the inputs of your prompts, and add a buffer to account for your prompt instructions themselves. You can manually copy paste the prompt instructions from the playground prompt-preview and ru it through the tokenizer for the model you're using for. We have a "show tokens" checkbox that also does this, but it uses the OpenAI tokenizer. the only way to do this is in python/ TS or whichever language you're using, before you call the BAML function at the moment. |
Beta Was this translation helpful? Give feedback.
Interesting, it seems like ollama doesn't error out and just truncates the input without throwing an exception like other model providers. Here is an ollama issue other folks raised: ollama/ollama#4967
To get around this, I would run the tokenizer on the inputs of your prompts, and add a buffer to account for your prompt instructions themselves. You can manually copy paste the prompt instructions from the playground prompt-preview and ru it through the tokenizer for the model you're using for. We have a "show tokens" checkbox that also does this, but it uses the OpenAI tokenizer.
the only way to do this is in python/ TS or whichever language you're using, before you call the BAML function…