Simba
commited on
Commit
•
c1ccc26
1
Parent(s):
a7a04f0
WIP
Browse files
app.py
CHANGED
@@ -36,25 +36,19 @@ def respond(image: np.ndarray, prompt: str, chat_history):
|
|
36 |
return "", chat_history
|
37 |
|
38 |
|
39 |
-
# Define the function that will process the inputs
|
40 |
-
def process(inputs):
|
41 |
-
image, prompt, chat_history = inputs
|
42 |
-
return respond(image, prompt, chat_history)
|
43 |
-
|
44 |
-
|
45 |
with gr.Blocks() as demo:
|
46 |
gr.Markdown(MARKDOWN)
|
47 |
with gr.Row():
|
48 |
-
webcam = gr.Image(
|
49 |
message = gr.Textbox()
|
50 |
chatbot = gr.Chatbot()
|
51 |
clear_button = gr.Button("Clear")
|
52 |
submit_button = gr.Button("Submit")
|
53 |
|
54 |
submit_button.click(
|
55 |
-
fn=
|
56 |
-
inputs=[webcam, message
|
57 |
-
outputs=[
|
58 |
)
|
59 |
|
60 |
clear_button.click(
|
@@ -63,4 +57,4 @@ with gr.Blocks() as demo:
|
|
63 |
outputs=[message, chatbot]
|
64 |
)
|
65 |
|
66 |
-
demo.launch(debug=
|
|
|
36 |
return "", chat_history
|
37 |
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
with gr.Blocks() as demo:
|
40 |
gr.Markdown(MARKDOWN)
|
41 |
with gr.Row():
|
42 |
+
webcam = gr.Image(sources=["webcam"], streaming=True, tool="select", type="numpy")
|
43 |
message = gr.Textbox()
|
44 |
chatbot = gr.Chatbot()
|
45 |
clear_button = gr.Button("Clear")
|
46 |
submit_button = gr.Button("Submit")
|
47 |
|
48 |
submit_button.click(
|
49 |
+
fn=respond,
|
50 |
+
inputs=[webcam, message],
|
51 |
+
outputs=[chatbot]
|
52 |
)
|
53 |
|
54 |
clear_button.click(
|
|
|
57 |
outputs=[message, chatbot]
|
58 |
)
|
59 |
|
60 |
+
demo.launch(debug=True, show_error=True)
|