Skip to content

What is the prompt length passed to the model? #1111

Answered by aaronvg
hhimanshu asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hhimanshu
Comment options

Answer selected by aaronvg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants