geshang commited on
Commit
80ea310
·
verified ·
1 Parent(s): f828f6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -164,16 +164,14 @@ def prepare_test_messages(image, prompt):
164
  image.save(buffered, format="JPEG")
165
  img_base64 = base64.b64encode(buffered.getvalue()).decode('utf-8')
166
 
167
- if "segment" in prompt or "mask" in prompt:
168
- SYSTEM_PROMPT = (
169
- "A conversation between User and Assistant. The user asks a question, and the Assistant solves it. The assistant "
170
- "first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning "
171
- "process should enclosed within <think> </think> tags, and the bounding box, points and points labels should be enclosed within <bbox></bbox>, <points></points>, and <labels></labels>, respectively. i.e., "
172
- "<think> reasoning process here </think> <bbox>[x1,y1,x2,y2]</bbox>, <points>[[x3,y3],[x4,y4],...]</points>, <labels>[1,0,...]</labels>"
173
- "Where 1 indicates a foreground (object) point, and 0 indicates a background point."
174
- )
175
- else:
176
- SYSTEM_PROMPT = "You're a helpful visual assistant."
177
 
178
  messages = [
179
  {"role": "system", "content": [{"type": "text", "text": SYSTEM_PROMPT}]},
 
164
  image.save(buffered, format="JPEG")
165
  img_base64 = base64.b64encode(buffered.getvalue()).decode('utf-8')
166
 
167
+ SYSTEM_PROMPT = (
168
+ "A conversation between User and Assistant. The user asks a question, and the Assistant solves it. The assistant "
169
+ "first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning "
170
+ "process should enclosed within <think> </think> tags, and the bounding box, points and points labels should be enclosed within <bbox></bbox>, <points></points>, and <labels></labels>, respectively. i.e., "
171
+ "<think> reasoning process here </think> <bbox>[x1,y1,x2,y2]</bbox>, <points>[[x3,y3],[x4,y4],...]</points>, <labels>[1,0,...]</labels>"
172
+ "Where 1 indicates a foreground (object) point, and 0 indicates a background point."
173
+ )
174
+
 
 
175
 
176
  messages = [
177
  {"role": "system", "content": [{"type": "text", "text": SYSTEM_PROMPT}]},