Skip to content

Commit 1e8022e

Browse files
RobinPicardrlouf
authored andcommitted
Set add_generation_template to True in chat formatting for Transformers
1 parent 07ebb56 commit 1e8022e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

outlines/models/transformers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ def format_str_input(self, model_input: str) -> str:
166166
def format_chat_input(self, model_input: Chat) -> str:
167167
return self.tokenizer.apply_chat_template(
168168
model_input.messages,
169-
tokenize=False
169+
tokenize=False,
170+
add_generation_prompt=True,
170171
)
171172

172173
def format_output_type(

0 commit comments

Comments
 (0)