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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -304,7 +304,9 @@ def run_pipeline(image: PILImage.Image, prompt: str):
304
  masks_np=[mask_np],
305
  alpha=0.6
306
  )
307
- output_text = re.findall(r'<think>(.*?)</think>', output_text, re.DOTALL)
 
 
308
  return output_text, visualized_img
309
  except Exception as e:
310
  print(f"Pipeline error: {e}")
 
304
  masks_np=[mask_np],
305
  alpha=0.6
306
  )
307
+ match = re.search(r'(<think>.*?</think>)', output_text, re.DOTALL)
308
+ if match:
309
+ output_text = match.group(1)
310
  return output_text, visualized_img
311
  except Exception as e:
312
  print(f"Pipeline error: {e}")