maxiw commited on
Commit
b3da3e6
1 Parent(s): 092c8d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -6,6 +6,7 @@ import torch
6
  import base64
7
  from PIL import Image
8
  from io import BytesIO
 
9
 
10
 
11
  models = {
@@ -62,7 +63,11 @@ def run_example(image, text_input, model_id="Qwen/Qwen2-VL-7B-Instruct"):
62
  output_text = processor.batch_decode(
63
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
64
  )
65
- return output_text
 
 
 
 
66
 
67
  css = """
68
  #output {
 
6
  import base64
7
  from PIL import Image
8
  from io import BytesIO
9
+ import re
10
 
11
 
12
  models = {
 
63
  output_text = processor.batch_decode(
64
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
65
  )
66
+
67
+ pattern = r'\[\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\]'
68
+ matches = re.findall(pattern, string)
69
+ result = [[int(num) for num in match] for match in matches]
70
+ return result
71
 
72
  css = """
73
  #output {