Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import os
|
|
| 4 |
import base64
|
| 5 |
from io import BytesIO
|
| 6 |
from project_model import process_inputs, session
|
|
|
|
| 7 |
|
| 8 |
# --- Helpers ---
|
| 9 |
def image_to_base64(img: Image.Image):
|
|
@@ -48,13 +49,14 @@ with gr.Blocks() as demo:
|
|
| 48 |
|
| 49 |
chatbot = gr.ChatInterface(
|
| 50 |
fn=handle_interaction,
|
|
|
|
| 51 |
additional_inputs=[
|
| 52 |
gr.Image(label="Upload or Capture Image (only needed initially)", sources=["upload", "webcam"], type="pil"),
|
| 53 |
gr.Audio(label="Question (Voice)", sources=["microphone"], type="filepath")
|
| 54 |
],
|
| 55 |
submit_btn="Ask / Submit",
|
| 56 |
clear_btn="Clear",
|
| 57 |
-
chatbot=gr.Chatbot(show_label=False)
|
| 58 |
)
|
| 59 |
|
| 60 |
if __name__ == "__main__":
|
|
|
|
| 4 |
import base64
|
| 5 |
from io import BytesIO
|
| 6 |
from project_model import process_inputs, session
|
| 7 |
+
pip install --upgrade gradio
|
| 8 |
|
| 9 |
# --- Helpers ---
|
| 10 |
def image_to_base64(img: Image.Image):
|
|
|
|
| 49 |
|
| 50 |
chatbot = gr.ChatInterface(
|
| 51 |
fn=handle_interaction,
|
| 52 |
+
retry_btn=None,
|
| 53 |
additional_inputs=[
|
| 54 |
gr.Image(label="Upload or Capture Image (only needed initially)", sources=["upload", "webcam"], type="pil"),
|
| 55 |
gr.Audio(label="Question (Voice)", sources=["microphone"], type="filepath")
|
| 56 |
],
|
| 57 |
submit_btn="Ask / Submit",
|
| 58 |
clear_btn="Clear",
|
| 59 |
+
chatbot=gr.Chatbot(show_label=False, type="messages")
|
| 60 |
)
|
| 61 |
|
| 62 |
if __name__ == "__main__":
|