Spaces:
Runtime error
Runtime error
Upload app.py
Browse files216 unmodified lines217218219220220221222223216 unmodified lines )
print("torch.no_grad")
# 解碼生成內容後
full_text = _hf_tok.decode(output_ids[0], skip_special_tokens=True)
full_text = _hf_tok.decode(out_ids[0], skip_special_tokens=True)
gen_text = full_text[len(prompt):] if full_text.startswith(prompt) else full_text
logs.append(f"[LOCAL LLM] raw_len={len(gen_text)}")
logs.append(f"[LOCAL LLM] raw_head={gen_text[:200].replace(chr(10),' ')}") # 前 200 字方便 Debugapp.py+1-1