Skip to content
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

Update QWEN_TOOL_PROMPT #6796

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

yueqis
Copy link
Contributor

@yueqis yueqis commented Feb 2, 2025

What does this PR do?

Modify QWEN_TOOL_PROMPT to have aligned format with hf apply chat template.
Currently, the qwen template output does not align with the hf apply chat template output when tools are included. Specifically, QWEN_TOOL_PROMPT in LLaMA-Factory/src/llamafactory/data/tool_utils.py contains <|im_end|>\n at the end, and self.format_system in LLaMA-Factory/src/llamafactory/data/template.py will add another <|im_end|>\n to the end of the formatted system prompt, causing there to be two sets of <|im_end|>\n in the system prompt when using tools.

Fixes # (issue)
N/A

Before submitting

@yueqis yueqis changed the title Update tool_utils.py Update QWEN_TOOL_PROMPT Feb 2, 2025
@hiyouga hiyouga self-requested a review February 4, 2025 15:47
Copy link
Owner

@hiyouga hiyouga left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants