[Feature] Unify the registration name recognition for tool_parser and reasoning_parser to “-” (#4668)

* parser register name unify

* change ernie_x1 to ernie-x1

* change ernie4_5_vl to ernie-45-vl

* fix unit test
This commit is contained in:
kxz2002
2025-10-31 10:45:27 +08:00
committed by GitHub
parent 82bd7e5db4
commit a2870ed4a9
16 changed files with 28 additions and 26 deletions

View File

@@ -101,7 +101,7 @@ def limit_thinking_content_length(
line_break_id: int = None,
):
if limit_strategy == "</think>":
# for ernie4_5_vl
# for ernie-45-vl
limit_thinking_content_length_v1(
sampled_token_ids,
max_think_lens,
@@ -110,7 +110,7 @@ def limit_thinking_content_length(
think_end_id,
)
elif limit_strategy == "\n</think>\n\n":
# for ernie_x1
# for ernie-x1
assert line_break_id > 0
limit_thinking_content_length_v2(
sampled_token_ids,
@@ -136,7 +136,7 @@ def speculate_limit_thinking_content_length(
line_break_id: int = None,
):
if limit_strategy == "</think>":
# for ernie4_5_vl
# for ernie-45-vl
speculate_limit_thinking_content_length_v1(
accept_tokens,
max_think_lens,
@@ -147,7 +147,7 @@ def speculate_limit_thinking_content_length(
think_end_id,
)
elif limit_strategy == "\n</think>\n\n":
# for ernie_x1
# for ernie-x1
assert line_break_id > 0
speculate_limit_thinking_content_length_v2(
accept_tokens,