Spaces:
Runtime error
Runtime error
Tim Seufert commited on
Commit ·
e3b6a11
1
Parent(s): 77f8e61
chatwindow_design_update
Browse files49 unmodified lines5051525354555657585960615 unmodified lines67686970717273747576777879808182838485868788899091929349 unmodified linesreturn "", chat_history.append((message, f"Error: {str(e)}"))# Create Gradio interface#with gr.Blocks() as demo:chatbot = gr.Chatbot()msg = gr.Textbox()img = gr.Image(type="filepath")clear = gr.ClearButton([msg, img, chatbot])# Set up message submissionmsg.submit(respond, [msg, img, chatbot], [msg, chatbot])5 unmodified lines)import timeimport gradio as grdef slow_echo(message, history):for i in range(len(message)):time.sleep(0.05)yield "You typed: " + message[: i + 1]demo = gr.ChatInterface(slow_echo,type="messages",flagging_mode="manual",flagging_options=["Like", "Spam", "Inappropriate", "Other"],save_history=True,)if __name__ == "__main__":demo.launch()#with gr.Interface() as iface:#iface.add_textbox("Message", lines=7, label="Message")49 unmodified lines50515253545556575859606162636465665 unmodified lines72737475767749 unmodified linesreturn "", chat_history.append((message, f"Error: {str(e)}"))# Create Gradio interfacewith gr.ChatInterface() as demo:chatbot = gr.Chatbot()msg = gr.Textbox()img = gr.Image(type="filepath")clear = gr.ClearButton([msg, img, chatbot])type="messages",flagging_mode="manual",flagging_options=["Like", "Spam", "Inappropriate", "Other"],save_history=True,# Set up message submissionmsg.submit(respond, [msg, img, chatbot], [msg, chatbot])5 unmodified lines)#with gr.Interface() as iface:#iface.add_textbox("Message", lines=7, label="Message")
app.py+7-23