akhaliq HF staff commited on
Commit
d7dd1ce
1 Parent(s): a154641

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -58,7 +58,8 @@ def chat(message, history):
58
  else:
59
  response = "I'm sorry, but I need an image to analyze. Please upload an image along with your question."
60
 
61
- return {"text": response, "files": []}
 
62
 
63
  with gr.Blocks() as demo:
64
  gr.Markdown("# Llama 3.2 Vision Multimodal Chatbot Demo")
@@ -67,8 +68,9 @@ with gr.Blocks() as demo:
67
  chatbot = MultimodalChatbot(
68
  value=[],
69
  height=800,
70
- callback=chat,
71
  )
 
 
72
 
73
  if __name__ == "__main__":
74
  demo.launch()
 
58
  else:
59
  response = "I'm sorry, but I need an image to analyze. Please upload an image along with your question."
60
 
61
+ history.append((message, {"text": response, "files": []}))
62
+ return history
63
 
64
  with gr.Blocks() as demo:
65
  gr.Markdown("# Llama 3.2 Vision Multimodal Chatbot Demo")
 
68
  chatbot = MultimodalChatbot(
69
  value=[],
70
  height=800,
 
71
  )
72
+
73
+ chatbot.submit(chat, [chatbot.messages, chatbot.messages], [chatbot.messages])
74
 
75
  if __name__ == "__main__":
76
  demo.launch()