[Feature]Optimization of Thinking Pattern Framework (#4302)

* add model status in vl

* add x1 parser

* add model_status

* fix parser

* fix parser

* fix parser

* fix parser

* Revert "fix parser"

This reverts commit 300f446d8a.

* fix parser

* fix

* fix

* fix

* fix

* fix parser

* fix unit test

* fix unit test

* add unit test

* fix

* fix

* add unit test

* fix unit test

* add unit test

* add unit test

* fix unit test

* fix unit test

* fix bug

* fix unit test

* x1 tool parser

* fix unit test

* fix unit test

* fix unit test

* fix n

* fix unit test

* add unit test

* add unit test

* remove pring
This commit is contained in:
luukunn
2025-12-10 16:17:06 +08:00
committed by GitHub
parent 1bffac866b
commit fbc9bce1e9
28 changed files with 1199 additions and 458 deletions
+25
View File
@@ -365,6 +365,31 @@ class TestQwenVLProcessor(unittest.TestCase):
# Verify both methods produce identical prompt strings
self.assertEqual(prompt, prompt2)
def test_think_status(self):
"""测试 思考机制"""
request = {
"prompt": "hello",
"request_id": "test_1",
"prompt_token_ids": [1, 2, 3],
"temperature": 0.7,
"top_p": 0.9,
}
self.processor.reasoning_parser = MagicMock()
self.processor.reasoning_parser.get_model_status.return_value = "think_start"
self.processor.model_status_dict = {}
self.processor.process_request_dict(request, max_model_len=512)
self.assertEqual(request["enable_thinking"], True)
request = {
"prompt": "hello",
"request_id": "test",
"prompt_token_ids": [1, 2, 3],
"temperature": 0.7,
"top_p": 0.9,
}
self.processor.process_request_dict(request, max_model_len=512)
self.assertEqual(request["enable_thinking"], True)
if __name__ == "__main__":
unittest.main()