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 falcon chat template #2464

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fastchat/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ def get_prompt(self) -> str:
elif self.sep_style == SeparatorStyle.FALCON_CHAT:
ret = ""
if self.system_message:
ret += "System: " + self.system_message + self.sep
ret += system_prompt + self.sep
for role, message in self.messages:
if message:
ret += role + ": " + message + self.sep
else:
ret += role + ": "
ret += role + ":"

return ret
else:
Expand Down Expand Up @@ -958,6 +958,7 @@ def get_conv_template(name: str) -> Conversation:
Conversation(
name="falcon-chat",
roles=("User", "Falcon"),
system_template="System: {system_message}",
messages=[],
sep_style=SeparatorStyle.FALCON_CHAT,
sep="\n",
Expand Down