Hi Franky,
I just obscured my API key by putting it in my environment variables and reran the code. Now, I get:
tenacity.RetryError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
Traceback:
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 565, in _run_script
exec(code, module.dict)
File “/app/cxbot/newui11.py”, line 54, in
index = construct_index(docs_directory_path)
File “/app/cxbot/newui11.py”, line 24, in construct_index
index = GPTSimpleVectorIndex(documents, llm_predictor=llm_predictor, prompt_helper=prompt_helper)
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/indices/vector_store/vector_indices.py”, line 84, in init
super().init(
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/indices/vector_store/base.py”, line 63, in init
super().init(
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/indices/base.py”, line 109, in init
self._index_struct = self.build_index_from_documents(documents)
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/token_counter/token_counter.py”, line 55, in wrapped_llm_predict
f_return_val = f(_self, *args, **kwargs)
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/indices/base.py”, line 278, in build_index_from_documents
return self._build_index_from_documents(documents)
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/indices/vector_store/base.py”, line 206, in _build_index_from_documents
self._add_document_to_index(index_struct, d)
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/indices/vector_store/base.py”, line 182, in _add_document_to_index
embedding_results = self._get_node_embedding_results(
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/indices/vector_store/base.py”, line 102, in _get_node_embedding_results
result_ids, result_embeddings = self._embed_model.get_queued_text_embeddings()
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/embeddings/base.py”, line 151, in get_queued_text_embeddings
embeddings = self._get_text_embeddings(cur_batch_texts)
File “/home/appuser/venv/lib/python3.9/site-packages/gpt_index/embeddings/openai.py”, line 260, in _get_text_embeddings
embeddings = get_embeddings(texts, engine=engine)
File “/home/appuser/venv/lib/python3.9/site-packages/tenacity/init.py”, line 289, in wrapped_f
return self(f, *args, **kw)
File “/home/appuser/venv/lib/python3.9/site-packages/tenacity/init.py”, line 379, in call
do = self.iter(retry_state=retry_state)
File “/home/appuser/venv/lib/python3.9/site-packages/tenacity/init.py”, line 326, in iter
raise retry_exc from fut.exception()
Do I need to add a virtual environment to the requirements.txt file?
Thanks for all of your help!