Tim Seufert commited on
Commit
eba68bc
·
1 Parent(s): 7471658
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -50,7 +50,7 @@ def respond(message, image, chat_history):
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")
@@ -66,3 +66,17 @@ with gr.Blocks() as demo:
66
  allowed_paths=["*"]
67
  )
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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")
 
66
  allowed_paths=["*"]
67
  )
68
 
69
+
70
+ with gr.Interface() as iface:
71
+ iface.add_textbox("Message", lines=7, label="Message")
72
+ iface.add_image("Image")
73
+ iface.add_textbox("Response", lines=7, label="Response")
74
+ iface.launch()
75
+ fn=respond,
76
+ inputs=[gr.Textbox(lines=7, label="Message"), gr.Image(label="Image")],
77
+ outputs=[gr.Textbox(lines=7, label="Response")],
78
+ title="SimplestMachine",
79
+ description="A simple chatbot interface powered by Cohere.",
80
+ allow_screenshot=True,
81
+ allow_file_upload=True,
82
+ theme="huggingface",