Woocy commited on
Commit
cde71bc
1 Parent(s): 266b51f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -15,7 +15,12 @@ logging.basicConfig(
15
  format="%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s",
16
  )
17
 
18
- my_api_key = "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" # 在这里输入你的 API 密钥
 
 
 
 
 
19
 
20
  # if we are running in Docker
21
  if os.environ.get("dockerrun") == "yes":
 
15
  format="%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s",
16
  )
17
 
18
+ @st.cache
19
+ def init_openai_settings():
20
+ openai.api_key = os.getenv("openai_key")
21
+
22
+ my_api_key = openai.api_key
23
+ #"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" # 在这里输入你的 API 密钥
24
 
25
  # if we are running in Docker
26
  if os.environ.get("dockerrun") == "yes":