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 sequence clipping bug in tokenizer #45

Open
justin-barton opened this issue Sep 9, 2023 · 1 comment
Open

Fix sequence clipping bug in tokenizer #45

justin-barton opened this issue Sep 9, 2023 · 1 comment
Assignees

Comments

@justin-barton
Copy link
Contributor

justin-barton commented Sep 9, 2023

Currently when using the tokenizer's batch_encode method with tensors and special tokens returned, the last two residues are truncated from the longest sequences. For example:

from protein_lm.tokenizer import AptTokenizer

tokenizer = AptTokenizer()

sequences = ["LAGERT", "SERPK"]

batch_encoded = tokenizer.batch_encode(
        sequences, 
        add_special_tokens=True, 
        return_tensors=True
    )

print(tokenizer.decode(batch_encoded[0]))

Outputs:

<cls>LAGE<eos>
@justin-barton
Copy link
Contributor Author

/take

@justin-barton justin-barton changed the title Fix length clipping bug in tokenizer Fix sequence clipping bug in tokenizer Sep 9, 2023
@pascalnotin pascalnotin moved this to In Progress in project-lm-scaling Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant