InfiniteDev commited on
Commit
e02187c
·
verified ·
1 Parent(s): e27ab5d

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -61,8 +61,8 @@ def split_reasoning(text: str, enable_thinking: bool) -> tuple[str, str]:
61
  return "", text.strip()
62
  if "</think>" in text:
63
  reasoning, answer = text.split("</think>", 1)
64
- return reasoning.strip(), answer.strip()
65
- return text.strip(), ""
66
 
67
 
68
  def history_to_messages(history: list[object] | None) -> list[dict[str, str]]:
@@ -150,7 +150,7 @@ def respond(
150
  ).to(model.device)
151
 
152
  streamer = TextIteratorStreamer(
153
- tokenizer, skip_prompt=True, skip_special_tokens=False
154
  )
155
  gen_kwargs = dict(
156
  **inputs,
 
61
  return "", text.strip()
62
  if "</think>" in text:
63
  reasoning, answer = text.split("</think>", 1)
64
+ return reasoning.replace("<think>", "").strip(), answer.strip()
65
+ return text.replace("<think>", "").strip(), ""
66
 
67
 
68
  def history_to_messages(history: list[object] | None) -> list[dict[str, str]]:
 
150
  ).to(model.device)
151
 
152
  streamer = TextIteratorStreamer(
153
+ tokenizer, skip_prompt=True, skip_special_tokens=True
154
  )
155
  gen_kwargs = dict(
156
  **inputs,