Skip to content

Commit a749dfa

Browse files
committed
Deleted 'thinking_budget' because it's not implemented yet.
1 parent 48d6507 commit a749dfa

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,9 +3719,6 @@ class Qwen3VLChatHandler(Llava15ChatHandler):
37193719
"{%- endfor -%}"
37203720
"{{- '\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <arguments-json-object>}\n</tool_call>\n\nYou can also return a response for the user alongside a function call:\n<response-for-user>\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <arguments-json-object>}\n</tool_call>' -}}"
37213721
"{%- endif -%}"
3722-
#"{%- if thinking_budget -%}"
3723-
# "{{- '\n\n# Reasoning\n\nYou must generate your reasoning steps within <think></think> XML tags:\n<think>\n<reasoning-content>\n</think>\n<final-response>\n\nThe reasoning content must not exceed the ' + thinking_budget + ' tokens budget.' -}}"
3724-
#"{%- endif -%}" # Doesn't work very well, disabled for now
37253722
"{{- '<|im_end|>\n' -}}"
37263723
"{%- set image_count = namespace(value=0) -%}"
37273724
#"{%- set video_count = namespace(value=0) -%}"
@@ -3788,29 +3785,20 @@ class Qwen3VLChatHandler(Llava15ChatHandler):
37883785

37893786
def __init__(
37903787
self,
3791-
thinking_budget: int | None = None,
37923788
force_reasoning: bool = False,
37933789
**kwargs,
37943790
):
37953791
"""
37963792
Parameters:
3797-
- thinking_budget (int | None): # Not implemented yet
3798-
- int: Number of max tokens for the reasoning.
3799-
- None (default): Without limit.
38003793
- force_reasoning (bool):
38013794
- True: Force the reasoning in the model by adding <think> to the chat template.
38023795
- False (default): Don't force the reasoning.
38033796
"""
3804-
self.thinking_budget = thinking_budget
38053797
self.force_reasoning = force_reasoning
38063798
super().__init__(**kwargs)
38073799

38083800
def __call__(self, **kwargs):
3809-
if self.thinking_budget is not None:
3810-
self.extra_template_arguments["thinking_budget"] = str(self.thinking_budget)
3811-
38123801
self.extra_template_arguments["force_reasoning"] = self.force_reasoning
3813-
38143802
llama = kwargs['llama']
38153803

38163804
# Clear state for multiple runs
@@ -3830,9 +3818,9 @@ def __call__(self, **kwargs):
38303818
messages = kwargs.get('messages', [])
38313819
try:
38323820
image_count = len(self.get_image_urls(messages))
3833-
print(f"Qwen3VLHandler(thinking_budget={self.thinking_budget}) - Cleared state, processing {image_count} images", file=sys.stderr)
3821+
print(f"Qwen3VLHandler(force_reasoning={self.force_reasoning}) - Cleared state, processing {image_count} images", file=sys.stderr)
38343822
except Exception:
3835-
print(f"Qwen3VLHandler(thinking_budget={self.thinking_budget}) - Cleared state", file=sys.stderr)
3823+
print(f"Qwen3VLHandler(force_reasoning={self.force_reasoning}) - Cleared state", file=sys.stderr)
38363824

38373825
# Use parent implementation
38383826
return super().__call__(**kwargs)

0 commit comments

Comments
 (0)