Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def chatbot_stream(user_input):
|
|
48 |
for chunk in completion:
|
49 |
text_chunk = chunk.choices[0].delta.content or ""
|
50 |
response += text_chunk
|
51 |
-
yield response
|
52 |
|
53 |
# Gradio UI with enhanced chat interface
|
54 |
def ui():
|
@@ -56,7 +56,7 @@ def ui():
|
|
56 |
with gr.Tabs():
|
57 |
with gr.TabItem("💬Chat"):
|
58 |
gr.Markdown("# AI Storyboard & Chatbot")
|
59 |
-
chatbot = gr.Chatbot(label="Storyboard Chatbot")
|
60 |
with gr.Row():
|
61 |
chat_input = gr.Textbox(
|
62 |
label="Your Message",
|
@@ -90,6 +90,6 @@ def ui():
|
|
90 |
storyboard_output = gr.Textbox(label="Generated Storyboard", interactive=False)
|
91 |
generate_btn.click(generate_storyboard, inputs=scenario_input, outputs=storyboard_output)
|
92 |
|
93 |
-
app.launch(
|
94 |
|
95 |
ui()
|
|
|
48 |
for chunk in completion:
|
49 |
text_chunk = chunk.choices[0].delta.content or ""
|
50 |
response += text_chunk
|
51 |
+
yield {"role": "assistant", "content": response}
|
52 |
|
53 |
# Gradio UI with enhanced chat interface
|
54 |
def ui():
|
|
|
56 |
with gr.Tabs():
|
57 |
with gr.TabItem("💬Chat"):
|
58 |
gr.Markdown("# AI Storyboard & Chatbot")
|
59 |
+
chatbot = gr.Chatbot(label="Storyboard Chatbot", type="messages")
|
60 |
with gr.Row():
|
61 |
chat_input = gr.Textbox(
|
62 |
label="Your Message",
|
|
|
90 |
storyboard_output = gr.Textbox(label="Generated Storyboard", interactive=False)
|
91 |
generate_btn.click(generate_storyboard, inputs=scenario_input, outputs=storyboard_output)
|
92 |
|
93 |
+
app.launch()
|
94 |
|
95 |
ui()
|