-
Notifications
You must be signed in to change notification settings - Fork 684
add Tool Parser #3272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Tool Parser #3272
Conversation
|
Thanks for your contribution! |
| args.reasoning_parser, | ||
| args.data_parallel_size, | ||
| args.enable_logprob, | ||
| args.tool_call_parser, |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面的 continue, 会影响计数
fastdeploy/input/ernie_processor.py
Outdated
| 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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
思考场景,不能 continue。
Merge branch 'tool-parser' of https://github.com/luukunn/FastDeploy into tool-parser
* 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] 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]>
增加tool parser解析能力
1.通过--tool-parser指定解析器,可以解析FC内容
2.通过--tool-parser-plugin指定解析文件,可以注册解析器