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

split completion text to sequence_len #616

Merged
merged 1 commit into from
Sep 22, 2023
Merged

Conversation

winglian
Copy link
Collaborator

This adds support for splitting completion text to the sequence_len rather than dropping or truncating.

@@ -77,7 +82,7 @@ def _tokenize(
result = self.tokenizer(
prompt,
truncation=True,
max_length=self.sequence_len,
max_length=self.max_length,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is max_length for? Since you're splitting long texts in the prompter, I don't quite understand what this is for.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the tokenizer no longer emits the entire tokenized string (it used to emit a warning), but now truncates it to max_length.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

without this, we would end up with truncated completion data, and we wouldn't be able to split it later on.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah I see. You split after tokenize, not before.

@winglian winglian merged commit 97d3776 into main Sep 22, 2023
4 checks passed
@winglian winglian deleted the completion-splitting branch September 22, 2023 01:51
mkeoliya pushed a commit to mkeoliya/axolotl that referenced this pull request Dec 15, 2023
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