去除OPENAI_API_KEY。
Browse files- .gitignore +2 -0
- app.py +2 -1
.gitignore
CHANGED
@@ -150,3 +150,5 @@ cython_debug/
|
|
150 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
151 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
152 |
#.idea/
|
|
|
|
|
|
150 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
151 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
152 |
#.idea/
|
153 |
+
|
154 |
+
.vscode/
|
app.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
# Note: you need to be using OpenAI Python v0.27.0 for the code below to work
|
3 |
import openai
|
4 |
import html
|
|
|
5 |
|
6 |
import gradio as gr
|
7 |
import random
|
@@ -18,7 +19,7 @@ MODELS = [
|
|
18 |
# 'gpt-4',
|
19 |
]
|
20 |
|
21 |
-
openai.api_key = "
|
22 |
|
23 |
def reduce_history(history):
|
24 |
mid = len(history) // 2
|
|
|
2 |
# Note: you need to be using OpenAI Python v0.27.0 for the code below to work
|
3 |
import openai
|
4 |
import html
|
5 |
+
import os
|
6 |
|
7 |
import gradio as gr
|
8 |
import random
|
|
|
19 |
# 'gpt-4',
|
20 |
]
|
21 |
|
22 |
+
openai.api_key = os.getenv("OPENAI_API_KEY")
|
23 |
|
24 |
def reduce_history(history):
|
25 |
mid = len(history) // 2
|