Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import os
|
3 |
|
4 |
# Set the environment variables
|
5 |
-
os.environ["OPENAI_API_KEY"] =
|
6 |
-
os.environ["INSTRUCTOR_PROMPT"] =
|
7 |
|
8 |
# Retrieve the API key and instructor prompt from environment variables
|
9 |
api_key = os.environ.get("OPENAI_API_KEY")
|
@@ -13,7 +14,6 @@ with gr.Blocks() as demo:
|
|
13 |
chat_history = gr.State(value=[])
|
14 |
|
15 |
def chat_with_instructor(message, history):
|
16 |
-
import openai
|
17 |
|
18 |
openai.api_key = api_key
|
19 |
chat_input = instructor_prompt + "\nUser: " + message + "\nInstructor:"
|
|
|
1 |
import gradio as gr
|
2 |
+
import openai
|
3 |
import os
|
4 |
|
5 |
# Set the environment variables
|
6 |
+
os.environ["OPENAI_API_KEY"] = INSTRUCTOR_API_KEY
|
7 |
+
os.environ["INSTRUCTOR_PROMPT"] = INSTRUCTOR_PROMPT
|
8 |
|
9 |
# Retrieve the API key and instructor prompt from environment variables
|
10 |
api_key = os.environ.get("OPENAI_API_KEY")
|
|
|
14 |
chat_history = gr.State(value=[])
|
15 |
|
16 |
def chat_with_instructor(message, history):
|
|
|
17 |
|
18 |
openai.api_key = api_key
|
19 |
chat_input = instructor_prompt + "\nUser: " + message + "\nInstructor:"
|