-
Notifications
You must be signed in to change notification settings - Fork 5
Error on splitting pdf file #14
Description
App is installed under Win11, conda vEnv (D:\LLM\ETL\vETL) & Python 3.10.0
GUI Error
AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.
File "D:\LLM\ETL\vETL\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "D:\LLM\ETL\vETL\PyProject\splitter.py", line 136, in
st.session_state.chunks = text_splitter(splitter_choice=splitter_choice, chunk_size=chunk_size, chunk_overlap=chunk_overlap, length_function=length_function, documents=documents)
File "D:\LLM\ETL\vETL\PyProject\utils.py", line 22, in text_splitter
splitter_code = llm_based_chunking_prep(documents[0].page_content)
File "D:\LLM\ETL\vETL\PyProject\SemanticHelpers\semantic_chunking.py", line 48, in llm_based_chunking_prep
chunking_strategy = llm_based_chunking_strategy(text=fixed_text)['content']
File "D:\LLM\ETL\vETL\PyProject\SemanticHelpers\semantic_chunking.py", line 20, in llm_based_chunking_strategy
response = openai.ChatCompletion.create(
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 149, in create
) = cls.__prepare_create_request(
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 106, in __prepare_create_request
requestor = api_requestor.APIRequestor(
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_requestor.py", line 138, in init
self.api_key = key or util.default_api_key()
File "D:\LLM\ETL\vETL\lib\site-packages\openai\util.py", line 186, in default_api_key
raise openai.error.AuthenticationError(
Conda prompt Error
raceback (most recent call last):
File "D:\LLM\ETL\vETL\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "D:\LLM\ETL\vETL\PyProject\splitter.py", line 136, in
st.session_state.chunks = text_splitter(splitter_choice=splitter_choice, chunk_size=chunk_size, chunk_overlap=chunk_overlap, length_function=length_function, documents=documents)
File "D:\LLM\ETL\vETL\PyProject\utils.py", line 22, in text_splitter
splitter_code = llm_based_chunking_prep(documents[0].page_content)
File "D:\LLM\ETL\vETL\PyProject\SemanticHelpers\semantic_chunking.py", line 48, in llm_based_chunking_prep
chunking_strategy = llm_based_chunking_strategy(text=fixed_text)['content']
File "D:\LLM\ETL\vETL\PyProject\SemanticHelpers\semantic_chunking.py", line 20, in llm_based_chunking_strategy
response = openai.ChatCompletion.create(
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 149, in create
) = cls.__prepare_create_request(
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 106, in __prepare_create_request
requestor = api_requestor.APIRequestor(
File "D:\LLM\ETL\vETL\lib\site-packages\openai\api_requestor.py", line 138, in init
self.api_key = key or util.default_api_key()
File "D:\LLM\ETL\vETL\lib\site-packages\openai\util.py", line 186, in default_api_key
raise openai.error.AuthenticationError(
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.