Wendy-Fly commited on
Commit
2a045f6
·
verified ·
1 Parent(s): f354af2

Upload infer_qwen2_vl.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. infer_qwen2_vl.py +3 -1
infer_qwen2_vl.py CHANGED
@@ -74,6 +74,8 @@ for batch_idx in tqdm(range(begin, end, batch_size)):
74
  for idx,i in enumerate(batch):
75
  #img = batch[i]
76
  print('gain image successfully !')
 
 
77
  messages[1]["content"][0]["image"] = '/inspire/hdd/ws-ba572160-47f8-4ca1-984e-d6bcdeb95dbb/a100-maybe/albus/ICCV_2025/qvq/dataset/' + i
78
  text = processor.apply_chat_template(
79
  messages, tokenize=False, add_generation_prompt=True
@@ -115,7 +117,7 @@ for batch_idx in tqdm(range(begin, end, batch_size)):
115
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
116
  )
117
  ans.append(output_text)
118
- save_path = "output.json"
119
  counter = counter + 1
120
  if counter % 1 == 0:
121
  print(f"Saving data at iteration {idx + 1}")
 
74
  for idx,i in enumerate(batch):
75
  #img = batch[i]
76
  print('gain image successfully !')
77
+ img_path = '/inspire/hdd/ws-ba572160-47f8-4ca1-984e-d6bcdeb95dbb/a100-maybe/albus/ICCV_2025/qvq/dataset/' + i
78
+ print(img_path)
79
  messages[1]["content"][0]["image"] = '/inspire/hdd/ws-ba572160-47f8-4ca1-984e-d6bcdeb95dbb/a100-maybe/albus/ICCV_2025/qvq/dataset/' + i
80
  text = processor.apply_chat_template(
81
  messages, tokenize=False, add_generation_prompt=True
 
117
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
118
  )
119
  ans.append(output_text)
120
+ save_path = "output_1.json"
121
  counter = counter + 1
122
  if counter % 1 == 0:
123
  print(f"Saving data at iteration {idx + 1}")