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

Cannot figure out where to find the .env file #26

Open
AvisP opened this issue Jul 26, 2023 · 11 comments
Open

Cannot figure out where to find the .env file #26

AvisP opened this issue Jul 26, 2023 · 11 comments

Comments

@AvisP
Copy link

AvisP commented Jul 26, 2023

I have never worked with streamlit before. I put in the API key from replicate in .env_template but not sure where to find the .env file? I renamed the .env_template to .env and kept in same directory but it didn't work. Kindly assist, thanks!

@mrpiwal
Copy link

mrpiwal commented Jul 26, 2023

Same problem I have

@randomrahulm
Copy link

can you explain more on this issue or code you have ,also which api is it?

@AvisP
Copy link
Author

AvisP commented Jul 26, 2023

There is a line in the Installation instruction Copy the '.env_template' file to '.env' and add your [Replicate API token](https://replicate.com/account) I added my replicate api but not sure where is the .env file located?

@matt-bornstein
Copy link
Collaborator

Sorry, this was not clear in the instructions and has now been updated.

Streamlit looks for a file called .env that contains environment variables. We provide the file .env_template to show which variable names are required. Before running/ deploying the app, you need to create a .env file using the command cp .env_template .env. Then edit this file with the proper values.

@AvisP
Copy link
Author

AvisP commented Jul 27, 2023

I have already done what you mentioned, I renamed the extension to .env but when I run the llama2_chatbot.py on the browser I get the message 'Add a .env file to your app directory with the keys specified in .env_template to continue.'.... I have made sure the file is in the same directory...

Snip1

Snip2

@matt-bornstein
Copy link
Collaborator

This error is thrown when the necessary env variables are not all present, I believe. Can you check against the latest .env_template? Or post a redacted screenshot of your .env file?

@Nyanziba
Copy link

I have the same problem. I solve this problem to change previous version of llama-chatbot.py. I think this part of llama-chatbot.py cause this problems.

AUTH0_CLIENTID = os.environ.get('AUTH0_CLIENTID', default='')
AUTH0_DOMAIN = os.environ.get('AUTH0_DOMAIN', default='')

if not (REPLICATE_API_TOKEN and REPLICATE_MODEL_ENDPOINT13B and REPLICATE_MODEL_ENDPOINT7B and 
        AUTH0_CLIENTID and AUTH0_DOMAIN):
    st.warning("Add a `.env` file to your app directory with the keys specified in `.env_template` to continue.")
    st.stop()`

@matt-bornstein
Copy link
Collaborator

my guess is that the app is throwing an error because you're not specifying AUTH0_CLIENT and AUTH0_DOMAIN? we can make auth optional with a runtime flag, if you'd prefer that

@evangineer
Copy link

Given how much of a hassle it is to set up Auth0 properly if you are running locally, that would probably be a good idea.

@evangineer
Copy link

Actually, the repo has now been updated and following the instructions will get it working:
#25

@matt-bornstein
Copy link
Collaborator

There's a new --noauth flag in this experimental branch, please try it out! You'll need to clone this branch, then run the script with streamlit run llama2_chatbot.py -- --noauth

https://github.com/a16z-infra/llama2-chatbot/tree/auth-optional-flag

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

6 participants