openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

after calling handle_file_string i get error message

Open rafboh opened this issue 2 years ago • 1 comments
trafficstars

[optional format]

Identify the file to be fixed transformers.py

Describe the problem after calling handle_file_string i get error message:

[handle_file_string] Error creating embedding: Traceback (most recent call last): File "", line 1, in File "/home/debian/development/gptchatbot/notebook.py", line 106, in addDocumentsToIndex handle_file_string((pdf_file,text.decode("utf-8")),tokenizer,redis_client,VECTOR_FIELD_NAME,INDEX_NAME) File "/home/debian/development/gptchatbot/transformers.py", line 87, in handle_file_string for i, (text_chunk, embedding) in enumerate(text_embeddings): UnboundLocalError: local variable 'text_embeddings' referenced before assignment

Describe a solution no solution yet, need help to solve the problem

rafboh avatar May 19 '23 05:05 rafboh

solved ! the reason was I was running the function without openAI key

rafboh avatar May 19 '23 07:05 rafboh