Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def tokenize_conversation(
add_generation_prompt=add_generation_prompt,
return_assistant_token_mask=False,
return_tensors="np",
return_dict=False,
chat_template=self._prompt_config.custom_chat_template,
)[0]

Expand All @@ -272,7 +273,10 @@ def tokenize_conversation(
raise ValueError(f"empty turn in conversation: {conversation}. Skipping.")

turn_tokens = self.tokenizer.apply_chat_template(
[turn], tokenize=True, chat_template=self._prompt_config.custom_chat_template
[turn],
tokenize=True,
return_dict=False,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How new is the return_dict argument? Are we going to be incompatible with an older but still used transformers version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jaredcasper should keep backward compatibility return_dict was False by default in older versions but they changed it to True in 5.3.0+

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we used 4.57.3 before this moment AFAIK

chat_template=self._prompt_config.custom_chat_template,
)

# There should be only one BOS at the very beginning.
Expand Down
Loading
Loading