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

remove space in deepseek template #1441

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

grimoire
Copy link
Collaborator

The generated prompts have space at the begin, but the space and the following word might be a single token. Add space after Assistant might lead to unexpected result.

Copy link
Collaborator

@AllentDan AllentDan left a comment

Choose a reason for hiding this comment

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

How about this?

lmdeploy/lmdeploy/model.py

Lines 895 to 899 in 4df476f

def get_prompt(self, prompt, sequence_start=True):
return super().get_prompt(prompt, sequence_start)[:-1]
def messages2prompt(self, messages, sequence_start=True):
return super().messages2prompt(messages, sequence_start)[:-1]

@lvhan028 lvhan028 merged commit 1f72b8f into InternLM:main Apr 18, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants