aadarsh99 commited on
Commit
b485573
·
1 Parent(s): b1ff212
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -111,6 +111,9 @@ def run_prediction(image_pil, user_text, threshold=0.5):
111
 
112
  # --- Prepend the required prefix ---
113
  full_prompt = f"Segment the {user_text.strip()}"
 
 
 
114
  logging.info(f"Processing prompt: {full_prompt}")
115
 
116
  ensure_models_loaded()
 
111
 
112
  # --- Prepend the required prefix ---
113
  full_prompt = f"Segment the {user_text.strip()}"
114
+ # remove trailing punctuation for consistency
115
+ if full_prompt[-1] in {".", "!", "?"}:
116
+ full_prompt = full_prompt[:-1]
117
  logging.info(f"Processing prompt: {full_prompt}")
118
 
119
  ensure_models_loaded()