Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -267,18 +267,12 @@ def solve(
|
|
| 267 |
pos = full_text.rfind(prompt)
|
| 268 |
completion = full_text[pos + len(prompt):] if pos != -1 else full_text
|
| 269 |
completion = strip_after_stop_text(completion, STOP_STRINGS)
|
| 270 |
-
return
|
| 271 |
|
| 272 |
-
# Raw mode: return the full continued expression
|
|
|
|
| 273 |
completion = strip_after_stop_text(full_text, STOP_STRINGS)
|
| 274 |
-
return
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
def _clean(text: str) -> str:
|
| 278 |
-
"""Display-only cleanup: drop the training-artifact `/no think` control
|
| 279 |
-
marker the model sometimes appends. Does not affect generation."""
|
| 280 |
-
text = strip_after_stop_text(text, [NO_THINK])
|
| 281 |
-
return text.strip()
|
| 282 |
|
| 283 |
|
| 284 |
CSS = """
|
|
|
|
| 267 |
pos = full_text.rfind(prompt)
|
| 268 |
completion = full_text[pos + len(prompt):] if pos != -1 else full_text
|
| 269 |
completion = strip_after_stop_text(completion, STOP_STRINGS)
|
| 270 |
+
return completion.strip()
|
| 271 |
|
| 272 |
+
# Raw mode: return the full continued expression, matching the reference
|
| 273 |
+
# inference script's behavior exactly (strip only at [IM_END]/[IM_START]).
|
| 274 |
completion = strip_after_stop_text(full_text, STOP_STRINGS)
|
| 275 |
+
return completion.strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 276 |
|
| 277 |
|
| 278 |
CSS = """
|