Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import openai
|
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
openai.api_key =
|
| 6 |
openai.api_base="https://api.fe8.cn/v1"
|
| 7 |
|
| 8 |
class Conversation:
|
|
@@ -53,7 +53,7 @@ with gr.Blocks(css="#chatbot{height:300px} .overflow-y-auto{height:500px}") as d
|
|
| 53 |
state = gr.State([])
|
| 54 |
|
| 55 |
with gr.Row():
|
| 56 |
-
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter")
|
| 57 |
|
| 58 |
txt.submit(answer, [txt, state], [chatbot, state])
|
| 59 |
|
|
|
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
openai.api_key = os.environ.get("OPENAI_API_KEY")
|
| 6 |
openai.api_base="https://api.fe8.cn/v1"
|
| 7 |
|
| 8 |
class Conversation:
|
|
|
|
| 53 |
state = gr.State([])
|
| 54 |
|
| 55 |
with gr.Row():
|
| 56 |
+
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter")
|
| 57 |
|
| 58 |
txt.submit(answer, [txt, state], [chatbot, state])
|
| 59 |
|