shukdevdattaEX commited on
Commit
765ede7
·
verified ·
1 Parent(s): 6929c34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -179,7 +179,7 @@ class MultimodalChatbot:
179
  prompt = f"<image_soft_token> {text_input}" if text_input else "<image_soft_token> Describe this image"
180
  output = self.pipe(image, text=prompt)
181
  description = output[0]['generated_text']
182
- content_parts.append({"type": "text", "text": f"Image analysis: {description}"})
183
  processing_info.append("🖼️ Image analyzed")
184
  except Exception as e:
185
  content_parts.append({"type": "text", "text": f"Error analyzing image: {str(e)}"})
@@ -525,7 +525,7 @@ def create_interface():
525
  )
526
  text_input.submit(
527
  process_text_input,
528
- inputs=[api_key_input, text_input,+Y text_chatbot],
529
  outputs=[text_chatbot, text_input]
530
  )
531
  text_clear_btn.click(clear_chat, outputs=[text_chatbot, text_input])
@@ -612,8 +612,8 @@ if __name__ == "__main__":
612
  "opencv-python",
613
  "numpy",
614
  "pydub",
615
- "transformers", # Added for image and video analysis
616
- "torch" # Added for transformers compatibility
617
  ]
618
 
619
  print("🚀 Multimodal Chatbot with Gemma 3n")
 
179
  prompt = f"<image_soft_token> {text_input}" if text_input else "<image_soft_token> Describe this image"
180
  output = self.pipe(image, text=prompt)
181
  description = output[0]['generated_text']
182
+ content_parts.append({"type": "text", "text": f"Image TwitchImage analysis: {description}"})
183
  processing_info.append("🖼️ Image analyzed")
184
  except Exception as e:
185
  content_parts.append({"type": "text", "text": f"Error analyzing image: {str(e)}"})
 
525
  )
526
  text_input.submit(
527
  process_text_input,
528
+ inputs=[api_key_input, text_input, text_chatbot],
529
  outputs=[text_chatbot, text_input]
530
  )
531
  text_clear_btn.click(clear_chat, outputs=[text_chatbot, text_input])
 
612
  "opencv-python",
613
  "numpy",
614
  "pydub",
615
+ "transformers",
616
+ "torch"
617
  ]
618
 
619
  print("🚀 Multimodal Chatbot with Gemma 3n")