Update app.py
Browse files
app.py
CHANGED
@@ -39,6 +39,8 @@ def respond(prompt, history):
|
|
39 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
40 |
]
|
41 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
|
|
|
|
42 |
print("Decoded response:", response)
|
43 |
|
44 |
# 返回回應
|
|
|
39 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
40 |
]
|
41 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
42 |
+
# **去除 `<think>` 及其他無用內容**
|
43 |
+
response = response.replace("<think>", "").replace("</think>", "").strip()
|
44 |
print("Decoded response:", response)
|
45 |
|
46 |
# 返回回應
|