Closed Kate-Lyndegaard closed 1 year ago
hey @Kate-Lyndegaard!
the error means the text snippet you are trying to embed is too big for the openai model to handle. you should chunk the text snippets so that it will fit into the model's max input tokens
Hi @hsm207 ,
OK, I will try doing that. I found this notebook which explains how to do it: https://github.com/openai/openai-cookbook/blob/main/examples/Embedding_long_inputs.ipynb
Kind regards, Kate
Hi,
Thank you for providing this tutorial.
I am trying to run the code, which I adapted to use with my data.
Example:
My Example PDFs:
testdata.zip
I receive the error: "message': "update vector: connection to: OpenAI API failed with status: 400 error: This model's maximum context length is 8191 tokens, however you requested 9657 tokens (9657 in your prompt; 0 for the completion). Please reduce your prompt; or completion length."}]}". I am using the module config from your example.
Do you have any recommendations on how to reduce the prompt, or update my schema, so that this works?
Kind regards, Kate