howard9963 commited on
Commit
78fcf69
·
verified ·
1 Parent(s): 95daccd

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -217,7 +217,7 @@ def call_llm(messages: List[dict], model: str, logs: List[str]) -> dict:
217
  )
218
  print("torch.no_grad")
219
  # 解碼生成內容後
220
- full_text = _hf_tok.decode(output_ids[0], skip_special_tokens=True)
221
  gen_text = full_text[len(prompt):] if full_text.startswith(prompt) else full_text
222
  logs.append(f"[LOCAL LLM] raw_len={len(gen_text)}")
223
  logs.append(f"[LOCAL LLM] raw_head={gen_text[:200].replace(chr(10),' ')}") # 前 200 字方便 Debug
 
217
  )
218
  print("torch.no_grad")
219
  # 解碼生成內容後
220
+ full_text = _hf_tok.decode(out_ids[0], skip_special_tokens=True)
221
  gen_text = full_text[len(prompt):] if full_text.startswith(prompt) else full_text
222
  logs.append(f"[LOCAL LLM] raw_len={len(gen_text)}")
223
  logs.append(f"[LOCAL LLM] raw_head={gen_text[:200].replace(chr(10),' ')}") # 前 200 字方便 Debug