polats commited on
Commit
e41a733
·
verified ·
1 Parent(s): 8f651ac

debug: raw decode

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- text = _tok.decode(out[0][_prompt_len(inputs):], skip_special_tokens=True)
124
- return text.strip() or "[EMPTY OUTPUT]"
 
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()