Spaces:
Runtime error
Runtime error
with gr.Row():
Browse files
app.py
CHANGED
|
@@ -95,8 +95,12 @@ with gr.Blocks(theme=theme) as demo:
|
|
| 95 |
with gr.Row():
|
| 96 |
chat_model = gr.Dropdown(choices=available_models, value="gpt-3.5-turbo", allow_custom_value=True)
|
| 97 |
openai_key = gr.Textbox(label="Enter OPENAI API Key", placeholder="Example: sk-AJDKakdAJD...")
|
| 98 |
-
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
with gr.Row():
|
| 102 |
with gr.Column(scale=2):
|
|
@@ -115,9 +119,7 @@ with gr.Blocks(theme=theme) as demo:
|
|
| 115 |
btn = gr.Button(scenario)
|
| 116 |
btn.click(lambda topic, chatbot_history, current_scenario=scenario: handle_scenario(topic, current_scenario, chatbot_history), [topic_input, chatbot], [chatbot], queue=False).then(**streaming_event_kwargs)
|
| 117 |
|
| 118 |
-
|
| 119 |
-
clear = gr.Button("Clear Chat History")
|
| 120 |
-
dark_mode_btn = gr.Button("Dark Mode", variant="primary")
|
| 121 |
|
| 122 |
msg.submit(show_message, [msg, chatbot], [msg, chatbot], queue=False).then(
|
| 123 |
**streaming_event_kwargs
|
|
|
|
| 95 |
with gr.Row():
|
| 96 |
chat_model = gr.Dropdown(choices=available_models, value="gpt-3.5-turbo", allow_custom_value=True)
|
| 97 |
openai_key = gr.Textbox(label="Enter OPENAI API Key", placeholder="Example: sk-AJDKakdAJD...")
|
| 98 |
+
|
| 99 |
+
with gr.Row():
|
| 100 |
+
topic_input = gr.Textbox(label="主題", placeholder="輸入主題...")
|
| 101 |
+
# audio = gr.Audio(label="Talk with ChatGPT", source="microphone", type="filepath", streaming=True)
|
| 102 |
+
clear = gr.Button("Clear Chat History")
|
| 103 |
+
dark_mode_btn = gr.Button("Dark Mode", variant="primary")
|
| 104 |
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column(scale=2):
|
|
|
|
| 119 |
btn = gr.Button(scenario)
|
| 120 |
btn.click(lambda topic, chatbot_history, current_scenario=scenario: handle_scenario(topic, current_scenario, chatbot_history), [topic_input, chatbot], [chatbot], queue=False).then(**streaming_event_kwargs)
|
| 121 |
|
| 122 |
+
|
|
|
|
|
|
|
| 123 |
|
| 124 |
msg.submit(show_message, [msg, chatbot], [msg, chatbot], queue=False).then(
|
| 125 |
**streaming_event_kwargs
|