mrprycep069 commited on
Commit
3ced757
1 Parent(s): ffe7e50

Update APIkeypath

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. openaiapikey.txt +1 -0
app.py CHANGED
@@ -11,16 +11,16 @@ Original file is located at
11
  # Commented out IPython magic to ensure Python compatibility.
12
  import openai
13
  import gradio
14
- from dotenv import load_dotenv
15
  import os
16
 
17
 
18
 
19
- def configure():
20
- load_dotenv()
 
21
 
22
  # %pdb on
23
- openai.api_key = os.getenv('api_key')
24
 
25
  menulist = [{"role": "system", "content": "You are ChatGPT Clone AI Robot"}]
26
 
 
11
  # Commented out IPython magic to ensure Python compatibility.
12
  import openai
13
  import gradio
 
14
  import os
15
 
16
 
17
 
18
+ def open_file(filepath):
19
+ with open(filepath, 'r' encoding='utf-8') as infile:
20
+ return infile.read()
21
 
22
  # %pdb on
23
+ openai.api_key = open_file('openaiapikey.text')
24
 
25
  menulist = [{"role": "system", "content": "You are ChatGPT Clone AI Robot"}]
26
 
openaiapikey.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 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