Spaces:
Running on Zero
Running on Zero
debug: raw decode
Browse files
app.py
CHANGED
|
@@ -120,8 +120,9 @@ def generate(system, user, max_tokens, temperature):
|
|
| 120 |
try:
|
| 121 |
inputs = _build_inputs(system, user)
|
| 122 |
out = _model.generate(**_gen_kwargs(inputs, max_tokens, temperature))
|
| 123 |
-
|
| 124 |
-
|
|
|
|
| 125 |
except Exception: # noqa: BLE001
|
| 126 |
import traceback
|
| 127 |
return "[ERROR]\n" + traceback.format_exc()
|
|
|
|
| 120 |
try:
|
| 121 |
inputs = _build_inputs(system, user)
|
| 122 |
out = _model.generate(**_gen_kwargs(inputs, max_tokens, temperature))
|
| 123 |
+
# DEBUG: raw decode (special tokens kept) to inspect the reasoning/response structure.
|
| 124 |
+
raw = _tok.decode(out[0][_prompt_len(inputs):], skip_special_tokens=False)
|
| 125 |
+
return "[RAW]\n" + raw
|
| 126 |
except Exception: # noqa: BLE001
|
| 127 |
import traceback
|
| 128 |
return "[ERROR]\n" + traceback.format_exc()
|