Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def process_request_dict(self, request, max_model_len=None):
if chat_template_kwargs:
if isinstance(chat_template_kwargs, dict):
for k, v in chat_template_kwargs.items():
if k not in request:
if k not in request or request[k] is None:
request[k] = v
else:
raise ValueError("Invalid input: chat_template_kwargs must be a dict")
Expand Down
2 changes: 1 addition & 1 deletion fastdeploy/input/qwen_vl_processor/qwen_vl_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def process_request_dict(self, request, max_model_len=None):
if chat_template_kwargs:
if isinstance(chat_template_kwargs, dict):
for k, v in chat_template_kwargs.items():
if k not in request:
if k not in request or request[k] is None:
request[k] = v
else:
raise ValueError("Invalid input: chat_template_kwargs must be a dict")
Expand Down
20 changes: 20 additions & 0 deletions tests/input/test_qwen_vl_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,26 @@ def test_process_request_dict(self):
result["multimodal_inputs"]["image_type_ids"].shape[0], result["multimodal_inputs"]["grid_thw"][:, 0].sum()
)

def test_process_request_dict_enable_thinking(self):
num_completion_token_ids = 10
request = {
"request_id": "12345",
"completion_token_ids": [1] * num_completion_token_ids,
"stop": ["stop", "eof"],
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Hello"},
],
}
],
"chat_template_kwargs": {"enable_thinking": True},
}

result = self.processor.process_request_dict(request, 100)
self.assertEqual(result.get("enable_thinking"), False)

def test_prompt(self):
"""
Test processing of prompt with image and video placeholders
Expand Down
Loading