Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File not found error #11

Open
DoLife opened this issue Jan 7, 2024 · 3 comments
Open

File not found error #11

DoLife opened this issue Jan 7, 2024 · 3 comments

Comments

@DoLife
Copy link

DoLife commented Jan 7, 2024

Hi

Thank you for the code.
It seems a file is missing that is needed.

FileNotFoundError: No secrets files found. Valid paths for a secrets.toml file are: C:\Users**.streamlit\secrets.toml

Where can I find this file or how can I create it and what exactly should be in the file?

Thank you

@TTomas78
Copy link
Collaborator

TTomas78 commented Jan 7, 2024

Hi! have you already created the config.ini file?
if not, create it on the proyect root folder, you can test if the proyect starts by filling with the follwing content
[DEFAULT]
API-KEY = {fill the value with your OPENAI API Key}

Please let me know if it's not the case.

@DoLife
Copy link
Author

DoLife commented Jan 7, 2024

Hi! have you already created the config.ini file? if not, create it on the proyect root folder, you can test if the proyect starts by filling with the follwing content [DEFAULT] API-KEY = {fill the value with your OPENAI API Key}

Please let me know if it's not the case.

It was created with the relevant key.
It us asking for a file called secrets.toml
I created that file in the directory where it is looking for the file as follows:
["LANGCHAIN_API_KEY"]
value = "hf_***************"

But now Im`receiving the following error ":
2024-01-07 08:53:44.355 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\Admin\anaconda3\envs\gptscraping\Lib\site-packages\streamlit\runtime\secrets.py", line 305, in getitem
value = self._parse(True)[key]
~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'LANGCHAIN_PROJECT'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Admin\anaconda3\envs\gptscraping\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "C:\GPT-auto-webscraping\app.py", line 21, in
os.environ["LANGCHAIN_PROJECT"]=st.secrets["LANGCHAIN_PROJECT"]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\anaconda3\envs\gptscraping\Lib\site-packages\streamlit\runtime\secrets.py", line 311, in getitem
raise KeyError(_missing_key_error_message(key))
KeyError: 'st.secrets has no key "LANGCHAIN_PROJECT". Did you forget to add it to secrets.toml or the app settings on Streamlit Cloud? More info: https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app/connect-to-data-sources/secrets-management'

Even when i launch the direct hugingface direct link it returns the same errors.

@GianfrancoCorrea
Copy link
Collaborator

hi @DoLife
This error is due our fault, we have an space in huggingface that consume some keys from streamlit secrets

You can delete these lines in the app.py to avoid using that variables, that are to track some information about the use of the space in hf

os.environ["LANGCHAIN_TRACING_V2"]="true"
os.environ["LANGCHAIN_ENDPOINT"]="https://api.smith.langchain.com"
os.environ["LANGCHAIN_API_KEY"]=st.secrets["LANGCHAIN_API_KEY"]
os.environ["LANGCHAIN_PROJECT"]=st.secrets["LANGCHAIN_PROJECT"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants