Spaces:
Sleeping
Sleeping
fix: append /no_thinking to all Qwen prompts to disable thinking mode via prompt
Browse files- agent.py +1 -1
- utils/wiki_tool.py +2 -3
agent.py
CHANGED
|
@@ -66,7 +66,7 @@ class AIBrain:
|
|
| 66 |
"""Sinh text với Qwen3 bằng huggingface_hub InferenceClient"""
|
| 67 |
try:
|
| 68 |
messages = [
|
| 69 |
-
{"role": "user", "content": prompt}
|
| 70 |
]
|
| 71 |
completion = self.client.chat.completions.create(
|
| 72 |
model=self.model_name,
|
|
|
|
| 66 |
"""Sinh text với Qwen3 bằng huggingface_hub InferenceClient"""
|
| 67 |
try:
|
| 68 |
messages = [
|
| 69 |
+
{"role": "user", "content": prompt + "\n/no_thinking"}
|
| 70 |
]
|
| 71 |
completion = self.client.chat.completions.create(
|
| 72 |
model=self.model_name,
|
utils/wiki_tool.py
CHANGED
|
@@ -132,9 +132,8 @@ Question: {question}
|
|
| 132 |
try:
|
| 133 |
completion = ai_client.chat.completions.create(
|
| 134 |
model="Qwen/Qwen3-8B",
|
| 135 |
-
messages=[{"role": "user", "content": prompt}],
|
| 136 |
-
max_tokens=32
|
| 137 |
-
enable_thinking=False
|
| 138 |
)
|
| 139 |
query = completion.choices[0].message.content.strip()
|
| 140 |
# Nếu AI trả về rỗng, fallback
|
|
|
|
| 132 |
try:
|
| 133 |
completion = ai_client.chat.completions.create(
|
| 134 |
model="Qwen/Qwen3-8B",
|
| 135 |
+
messages=[{"role": "user", "content": prompt + "\n/no_thinking"}],
|
| 136 |
+
max_tokens=32
|
|
|
|
| 137 |
)
|
| 138 |
query = completion.choices[0].message.content.strip()
|
| 139 |
# Nếu AI trả về rỗng, fallback
|