multimodalart HF Staff commited on
Commit
b3115fb
·
verified ·
1 Parent(s): dba4082

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -10
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 _clean(completion)
271
 
272
- # Raw mode: return the full continued expression.
 
273
  completion = strip_after_stop_text(full_text, STOP_STRINGS)
274
- return _clean(completion)
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 = """