Haozhe commited on
Commit
9d62401
·
1 Parent(s): 4f54f7b
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -13,7 +13,7 @@ from serve_constants import html_header, bibtext, learn_more_markdown, tos_markd
13
  MODEL_ID = "TIGER-Lab/PixelReasoner-RL-v1"
14
  # MODEL_ID = "/home/ma-user/work/haozhe/workspace/lmm-r1/toolckpts/pix17K0506wt-NormalizedPenalizedFixedReweightCont-256-lossvernone-samplevernone-fmtnone-group-n8-ml10000-lr10-sysvcot-8node/global_step24_hf_evalbest"
15
  example_image = "example_images/1.jpg" # /home/ma-user/work/haozhe/workspace/vlspaces/
16
- # "example_images/document.png"
17
  example_text = "What kind of restaurant is it?"
18
  processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True,
19
  # min_pixels=min_pixels,
@@ -160,6 +160,15 @@ def model_inference(input_dict, history):
160
  if val[1]:
161
  messages.append({"role": "assistant", "content": val[1]})
162
 
 
 
 
 
 
 
 
 
 
163
  imagelist = rawimagelist = current_message_images = [load_image(image) for image in files]
164
  all_images += current_message_images
165
  messages.append({
 
13
  MODEL_ID = "TIGER-Lab/PixelReasoner-RL-v1"
14
  # MODEL_ID = "/home/ma-user/work/haozhe/workspace/lmm-r1/toolckpts/pix17K0506wt-NormalizedPenalizedFixedReweightCont-256-lossvernone-samplevernone-fmtnone-group-n8-ml10000-lr10-sysvcot-8node/global_step24_hf_evalbest"
15
  example_image = "example_images/1.jpg" # /home/ma-user/work/haozhe/workspace/vlspaces/
16
+ # example_image = "/home/ma-user/work/haozhe/workspace/vlspaces/example_images/1.jpg"
17
  example_text = "What kind of restaurant is it?"
18
  processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True,
19
  # min_pixels=min_pixels,
 
160
  if val[1]:
161
  messages.append({"role": "assistant", "content": val[1]})
162
 
163
+ current_path = os.getcwd()
164
+ print(f"Current running path: {current_path}")
165
+
166
+ # Define the folder name to check
167
+ folder_to_find = "example_images"
168
+
169
+ # Create the full path to the folder
170
+ folder_path = os.path.join(current_path, folder_to_find)
171
+ print('files', files)
172
  imagelist = rawimagelist = current_message_images = [load_image(image) for image in files]
173
  all_images += current_message_images
174
  messages.append({