maxiw commited on
Commit
bf9c4d3
·
verified ·
1 Parent(s): f3a13dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -90,6 +90,8 @@ def run_example(image, text_input, system_prompt, model_id="OS-Copilot/OS-Atlas-
90
  object_ref_pattern = r"<\|object_ref_start\|>(.*?)<\|object_ref_end\|>"
91
  box_pattern = r"<\|box_start\|>(.*?)<\|box_end\|>"
92
 
 
 
93
  object_ref = re.search(object_ref_pattern, text).group(1)
94
  box_content = re.search(box_pattern, text).group(1)
95
 
@@ -106,7 +108,7 @@ css = """
106
  border: 1px solid #ccc;
107
  }
108
  """
109
- default_system_prompt = "You are a helpfull assistant to detect objects in images. When asked to detect elements based on a description you return bounding boxes for all elements in the form of [xmin, ymin, xmax, ymax] whith the values beeing scaled to 1000 by 1000 pixels. When there are more than one result, answer with a list of bounding boxes in the form of [[xmin, ymin, xmax, ymax], [xmin, ymin, xmax, ymax], ...]."
110
 
111
  with gr.Blocks(css=css) as demo:
112
  gr.Markdown(
 
90
  object_ref_pattern = r"<\|object_ref_start\|>(.*?)<\|object_ref_end\|>"
91
  box_pattern = r"<\|box_start\|>(.*?)<\|box_end\|>"
92
 
93
+ print(text)
94
+ print(re.search(object_ref_pattern, text))
95
  object_ref = re.search(object_ref_pattern, text).group(1)
96
  box_content = re.search(box_pattern, text).group(1)
97
 
 
108
  border: 1px solid #ccc;
109
  }
110
  """
111
+ default_system_prompt = ""
112
 
113
  with gr.Blocks(css=css) as demo:
114
  gr.Markdown(