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

Fix Baichuan chat template #3340

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

Dinghow
Copy link
Contributor

@Dinghow Dinghow commented Mar 12, 2024

The previous template_baichuan.jinja generates extra \n compared with official implementation.

Given the input messages is

[
    {'role': 'user', 'content': 'Hello, who are you'},
    {'role': 'assistant', 'content': 'I am a large language model from Baichuan Inc'},
    {'role': 'user', 'content': "What's the capital of Canada?"},
]

The text generated by the official version:
<reserved_106>Hello, who are you<reserved_107>I am a large language model from Baichuan Inc<reserved_106>What's the capital of Canada?<reserved_107>

while previous template_baichuan.jinja:
\n\n<reserved_106>\nHello, who are you\n\n<reserved_107>\nI am a large language model from Baichuan Inc\n\n<reserved_106>\nWhat's the capital of Canada?<reserved_107>\n

This PR fix the jinja template based on the official version.

@Dinghow
Copy link
Contributor Author

Dinghow commented Mar 15, 2024

@simon-mo also cc this?

@simon-mo simon-mo merged commit cf6ff18 into vllm-project:main Mar 16, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants