Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,9 +35,7 @@ def chat_with_bot_stream(user_input, temperature, top_p):
|
|
| 35 |
|
| 36 |
conversation_history.append({"role": "assistant", "content": response_content})
|
| 37 |
|
| 38 |
-
return
|
| 39 |
-
msg["content"] if msg["role"] == "assistant" else None)
|
| 40 |
-
for msg in conversation_history]
|
| 41 |
|
| 42 |
# Function to generate a storyboard
|
| 43 |
def generate_storyboard(scenario, temperature, top_p):
|
|
@@ -105,7 +103,7 @@ with gr.Blocks(theme=gr.themes.Glass(primary_hue="violet", secondary_hue="emeral
|
|
| 105 |
with gr.Tabs():
|
| 106 |
with gr.TabItem("💬Chat"):
|
| 107 |
gr.HTML(TITLE)
|
| 108 |
-
chatbot = gr.Chatbot(label="Storyboard Chatbot")
|
| 109 |
with gr.Row():
|
| 110 |
user_input = gr.Textbox(
|
| 111 |
label="Your Message",
|
|
@@ -115,8 +113,7 @@ with gr.Blocks(theme=gr.themes.Glass(primary_hue="violet", secondary_hue="emeral
|
|
| 115 |
send_button = gr.Button("✋Ask Question")
|
| 116 |
|
| 117 |
with gr.Accordion("🛠️ Customize Chatbot", open=False):
|
| 118 |
-
|
| 119 |
-
top_p_component.render()
|
| 120 |
|
| 121 |
with gr.Accordion("🧪 Example Questions", open=False):
|
| 122 |
example_radio = gr.Radio(
|
|
@@ -154,8 +151,7 @@ with gr.Blocks(theme=gr.themes.Glass(primary_hue="violet", secondary_hue="emeral
|
|
| 154 |
storyboard_output = gr.Textbox(label="Generated Storyboard", interactive=False)
|
| 155 |
|
| 156 |
with gr.Accordion("🛠️ Customize Storyboard", open=False):
|
| 157 |
-
|
| 158 |
-
top_p_component.render()
|
| 159 |
|
| 160 |
generate_btn.click(
|
| 161 |
generate_storyboard,
|
|
|
|
| 35 |
|
| 36 |
conversation_history.append({"role": "assistant", "content": response_content})
|
| 37 |
|
| 38 |
+
return conversation_history
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# Function to generate a storyboard
|
| 41 |
def generate_storyboard(scenario, temperature, top_p):
|
|
|
|
| 103 |
with gr.Tabs():
|
| 104 |
with gr.TabItem("💬Chat"):
|
| 105 |
gr.HTML(TITLE)
|
| 106 |
+
chatbot = gr.Chatbot(label="Storyboard Chatbot", type="messages")
|
| 107 |
with gr.Row():
|
| 108 |
user_input = gr.Textbox(
|
| 109 |
label="Your Message",
|
|
|
|
| 113 |
send_button = gr.Button("✋Ask Question")
|
| 114 |
|
| 115 |
with gr.Accordion("🛠️ Customize Chatbot", open=False):
|
| 116 |
+
gr.Row([temperature_component, top_p_component])
|
|
|
|
| 117 |
|
| 118 |
with gr.Accordion("🧪 Example Questions", open=False):
|
| 119 |
example_radio = gr.Radio(
|
|
|
|
| 151 |
storyboard_output = gr.Textbox(label="Generated Storyboard", interactive=False)
|
| 152 |
|
| 153 |
with gr.Accordion("🛠️ Customize Storyboard", open=False):
|
| 154 |
+
gr.Row([temperature_component, top_p_component])
|
|
|
|
| 155 |
|
| 156 |
generate_btn.click(
|
| 157 |
generate_storyboard,
|