akhaliq HF staff commited on
Commit
6a8b740
1 Parent(s): 3d1b39b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -45,7 +45,7 @@ def chat_with_image(message, image, history):
45
  if encoded_image:
46
  messages.append({
47
  "role": "user",
48
- "content": f"[IMAGE]{encoded_image}[/IMAGE]\n{message or 'What\'s in this image?'}"
49
  })
50
  else:
51
  messages.append({"role": "user", "content": "I tried to upload an image, but there was an error."})
@@ -75,6 +75,7 @@ def chat_with_image(message, image, history):
75
  except Exception as e:
76
  yield f"An error occurred: {str(e)}"
77
 
 
78
  # Create the Gradio interface
79
  with gr.Blocks() as demo:
80
  chatbot = gr.Chatbot()
 
45
  if encoded_image:
46
  messages.append({
47
  "role": "user",
48
+ "content": f"[IMAGE]{encoded_image}[/IMAGE]\n{message or \"What's in this image?\"}"
49
  })
50
  else:
51
  messages.append({"role": "user", "content": "I tried to upload an image, but there was an error."})
 
75
  except Exception as e:
76
  yield f"An error occurred: {str(e)}"
77
 
78
+
79
  # Create the Gradio interface
80
  with gr.Blocks() as demo:
81
  chatbot = gr.Chatbot()