jh000107 commited on
Commit
4446131
·
1 Parent(s): 96dc934

final version

Browse files
Files changed (2) hide show
  1. _.env +0 -1
  2. app.py +4 -4
_.env DELETED
@@ -1 +0,0 @@
1
- OPENAI_API_KEY=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
 
 
app.py CHANGED
@@ -294,10 +294,10 @@ def get_completion(conversation, model="gpt-4-1106-preview"):
294
  return response.choices[0].message.content, fig
295
 
296
  def set_key(key):
297
- with open("_.env", "w") as file:
298
- file.write(f"OPENAI_API_KEY={key}")
299
-
300
- load_dotenv(find_dotenv("_.env"), override=True)
301
  return
302
 
303
  import gradio as gr
 
294
  return response.choices[0].message.content, fig
295
 
296
  def set_key(key):
297
+
298
+ os.environ['OPENAI_API_KEY'] = key
299
+ load_dotenv()
300
+
301
  return
302
 
303
  import gradio as gr