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

Perplexity metric does not apply batching correctly to tokenization #573

Open
ChengSashankh opened this issue Apr 14, 2024 · 1 comment
Open

Comments

@ChengSashankh
Copy link

ChengSashankh commented Apr 14, 2024

When I try to evaluate my model's text generation using the perplexity metric, the batch_size parameters in perplexity._compute(..) was not sufficient, because it tries to tokenize and move the entire set of predictions to GPU. A simple change to move the tokenization to each batch fixes the issue for me.

Also, it should be possible to pass my own model and tokenizer (since my model is not publishable on huggingface) to the metric. I have made these changes to enable my experiments.

I have made changes to fix this. I can open a PR to commit these changes, if this sounds good to you. I believe this will benefit the developer community.

@abhibambhaniya
Copy link

I am also facing the same issue.

@ChengSashankh ChengSashankh changed the title Perplexity metric in HuggingFace evaluate does not apply batching to tokenization Perplexity metric in HuggingFace evaluate does not apply batching correctly to tokenization Apr 14, 2024
@ChengSashankh ChengSashankh changed the title Perplexity metric in HuggingFace evaluate does not apply batching correctly to tokenization Perplexity metric in does not apply batching correctly to tokenization Apr 14, 2024
@ChengSashankh ChengSashankh changed the title Perplexity metric in does not apply batching correctly to tokenization Perplexity metric does not apply batching correctly to tokenization Apr 14, 2024
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

No branches or pull requests

2 participants