Skip to content

Conversation

@luukunn
Copy link
Collaborator

@luukunn luukunn commented Aug 8, 2025

增加tool parser解析能力
1.通过--tool-parser指定解析器,可以解析FC内容
2.通过--tool-parser-plugin指定解析文件,可以注册解析器

@paddle-bot
Copy link

paddle-bot bot commented Aug 8, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Aug 8, 2025
args.reasoning_parser,
args.data_parallel_size,
args.enable_logprob,
args.tool_call_parser,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

离线接口也需要增加

if args.tokenizer is None:
args.tokenizer = args.model
if args.tool_parser_plugin:
ToolParserManager.import_tool_parser(args.tool_parser_plugin)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不适合放在多进程启动的模块中

tool_calls=output.get("tool_call_content", []),
tool_calls=None,
)
previous_num_tokens += len(output["token_ids"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面的 continue, 会影响计数

self.eos_token_id_len = len(self.eos_token_ids)
self.pad_token_id = self.get_pad_id()
self.reasoning_parser = None
self.tool_parser = tool_parser_obj
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 self.tool_parser_obj 吧

delta_message = DeltaMessage(
if self.engine_client.data_processor.tool_parser and not res["finished"]:
tool_delta_message = output["tool_delta_message"]
if tool_delta_message is None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

思考场景,不能 continue。

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit eda83ca into PaddlePaddle:develop Aug 12, 2025
17 of 22 checks passed
luukunn added a commit to luukunn/FastDeploy that referenced this pull request Aug 21, 2025
* add tool-parser

* add tool-parser

* add tool parser

* add tool parser

* fix

* add offline

* add offline

* fix

* parsers:tool&reasoning

* 修改tool parser名称·

* update

* fix reasoning-parser

* add requirements

* fix finish reason

* fix

* fix reasoning-parser

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: zhuzixuan <[email protected]>
Jiang-Jia-Jun pushed a commit that referenced this pull request Aug 22, 2025
* [Feature] Pass through the `chat_template_kwargs` to the data processing module (#3421)

* fix chat_template_args

* fix args

* add offline

* add offline

* fix

* fix

* fix default enable_thinking value

* fix default enable_thinking value

* modify condition

* Revert "modify condition"

This reverts commit 26430bd.

* fix unit test

* add Tool Parser (#3272)

* add tool-parser

* add tool-parser

* add tool parser

* add tool parser

* fix

* add offline

* add offline

* fix

* parsers:tool&reasoning

* 修改tool parser名称·

* update

* fix reasoning-parser

* add requirements

* fix finish reason

* fix

* fix reasoning-parser

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: zhuzixuan <[email protected]>

* [Feature] add tool parser (#3483)

* add tool parser

* add x1 enable_thinking

* restart ci

* fix vl reasoning parser

* modify call style

* modify call style

* add offline enablethinking

* fix completion

* fix

* fix unit test

* fix unit test

* fix unit test

* fix vl reasoning parser

* fix vl reasoning parser

* fix unit test

---------

Co-authored-by: zhuzixuan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants