hbui commited on
Commit
638c8db
·
1 Parent(s): 745ce98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -24,10 +24,15 @@ index = None
24
 
25
  #api_key = st.text_input("Enter your OpenAI API key here:", type="password")
26
 
27
- from dotenv import load_dotenv, find_dotenv
28
- _ = load_dotenv(find_dotenv()) # read local .env file
29
 
30
- api_key = os.environ['OPENAI_API_KEY']
 
 
 
 
 
31
 
32
  if api_key:
33
  resp = validate(api_key)
 
24
 
25
  #api_key = st.text_input("Enter your OpenAI API key here:", type="password")
26
 
27
+ #from dotenv import load_dotenv, find_dotenv
28
+ #_ = load_dotenv(find_dotenv()) # read local .env file
29
 
30
+ #api_key = os.environ['OPENAI_API_KEY']
31
+
32
+ from huggingface_hub import secrets
33
+
34
+ # Replace "OPENAI_API_KEY" with the actual name of your secret
35
+ api_key = secrets.get("OPENAI_API_KEY")
36
 
37
  if api_key:
38
  resp = validate(api_key)