release
Browse files
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()
|