Spaces:
Running
Running
Tim Seufert
commited on
Commit
·
24fa1f4
1
Parent(s):
e3b6a11
chatwindow_design_update
Browse files
app.py
CHANGED
@@ -50,17 +50,12 @@ def respond(message, image, chat_history):
|
|
50 |
return "", chat_history.append((message, f"Error: {str(e)}"))
|
51 |
|
52 |
# Create Gradio interface
|
53 |
-
|
54 |
-
with gr.ChatInterface() as demo:
|
55 |
chatbot = gr.Chatbot()
|
56 |
msg = gr.Textbox()
|
57 |
img = gr.Image(type="filepath")
|
58 |
clear = gr.ClearButton([msg, img, chatbot])
|
59 |
-
|
60 |
-
type="messages",
|
61 |
-
flagging_mode="manual",
|
62 |
-
flagging_options=["Like", "Spam", "Inappropriate", "Other"],
|
63 |
-
save_history=True,
|
64 |
# Set up message submission
|
65 |
msg.submit(respond, [msg, img, chatbot], [msg, chatbot])
|
66 |
|
@@ -72,6 +67,20 @@ with gr.ChatInterface() as demo:
|
|
72 |
)
|
73 |
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
#with gr.Interface() as iface:
|
77 |
#iface.add_textbox("Message", lines=7, label="Message")
|
|
|
50 |
return "", chat_history.append((message, f"Error: {str(e)}"))
|
51 |
|
52 |
# Create Gradio interface
|
53 |
+
#with gr.Blocks() as demo:
|
|
|
54 |
chatbot = gr.Chatbot()
|
55 |
msg = gr.Textbox()
|
56 |
img = gr.Image(type="filepath")
|
57 |
clear = gr.ClearButton([msg, img, chatbot])
|
58 |
+
|
|
|
|
|
|
|
|
|
59 |
# Set up message submission
|
60 |
msg.submit(respond, [msg, img, chatbot], [msg, chatbot])
|
61 |
|
|
|
67 |
)
|
68 |
|
69 |
|
70 |
+
import time
|
71 |
+
import gradio as gr
|
72 |
+
|
73 |
+
demo = gr.ChatInterface(
|
74 |
+
chatbot = gr.Chatbot()
|
75 |
+
msg = gr.Textbox
|
76 |
+
flagging_mode="manual",
|
77 |
+
flagging_options=["Like", "Spam", "Inappropriate", "Other"],
|
78 |
+
save_history=True,
|
79 |
+
)
|
80 |
+
|
81 |
+
if __name__ == "__main__":
|
82 |
+
demo.launch()
|
83 |
+
|
84 |
|
85 |
#with gr.Interface() as iface:
|
86 |
#iface.add_textbox("Message", lines=7, label="Message")
|