GiantPandas commited on
Commit
e1d3bbe
·
verified ·
1 Parent(s): 149b344

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -144,17 +144,13 @@ def _launch_demo(args):
144
  "url": f"data:image/jpeg;base64,{encode_image(q[0])}"
145
  }
146
  })
147
- elif q and q.strip():
148
  content.append({"type": "text", 'text': q})
149
  messages.append({'role': 'user', 'content': content})
150
- if a:
151
- messages.append({'role': 'assistant', 'content': [{"type": "text", 'text': a}]})
152
- content = []
153
- else:
154
- continue
155
-
156
-
157
 
 
 
 
158
  messages.pop()
159
  responses = client.chat.completions.create(
160
  model="Qwen2_5VL",
 
144
  "url": f"data:image/jpeg;base64,{encode_image(q[0])}"
145
  }
146
  })
147
+ else:
148
  content.append({"type": "text", 'text': q})
149
  messages.append({'role': 'user', 'content': content})
 
 
 
 
 
 
 
150
 
151
+ messages.append({'role': 'assistant', 'content': [{"type": "text", 'text': a}]})
152
+ content = []
153
+
154
  messages.pop()
155
  responses = client.chat.completions.create(
156
  model="Qwen2_5VL",