alliwene commited on
Commit
032e2a4
·
1 Parent(s): 5c53975

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. backend.py +6 -11
  2. notebook.ipynb +3 -4
backend.py CHANGED
@@ -1,19 +1,14 @@
1
- import openai
2
- import gradio as gr
3
- from typing import List, Dict
4
- import click
5
-
6
- # load .env
7
  import os
8
- from dotenv import load_dotenv
9
- from pprint import pprint
10
 
 
11
  import openai
 
12
 
13
- load_dotenv()
14
-
15
 
16
- openai.api_key = os.getenv("API_KEY")
 
17
 
18
 
19
  message_history = []
 
 
 
 
 
 
 
1
  import os
2
+ from typing import List
 
3
 
4
+ from dotenv import load_dotenv
5
  import openai
6
+ import gradio as gr
7
 
8
+ print(f"{'+'*100} {load_dotenv()}")
 
9
 
10
+ if load_dotenv():
11
+ openai.api_key = os.getenv("API_KEY")
12
 
13
 
14
  message_history = []
notebook.ipynb CHANGED
@@ -31,7 +31,8 @@
31
  "\n",
32
  "import openai\n",
33
  "\n",
34
- "load_dotenv()"
 
35
  ]
36
  },
37
  {
@@ -39,9 +40,7 @@
39
  "execution_count": 5,
40
  "metadata": {},
41
  "outputs": [],
42
- "source": [
43
- "openai.api_key = os.getenv('API_KEY')"
44
- ]
45
  },
46
  {
47
  "cell_type": "code",
 
31
  "\n",
32
  "import openai\n",
33
  "\n",
34
+ "if load_dotenv():\n",
35
+ " openai.api_key = os.getenv('OPENAI_API_KEY')\n"
36
  ]
37
  },
38
  {
 
40
  "execution_count": 5,
41
  "metadata": {},
42
  "outputs": [],
43
+ "source": []
 
 
44
  },
45
  {
46
  "cell_type": "code",