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

Nanotron greedy_until() fix #344

Merged
merged 7 commits into from
Nov 8, 2024

Conversation

vsabolcec
Copy link
Contributor

Evaluating a nanotron checkpoint on a benchmark with a GreedyUntil request crashes with the following error message:

0: [rank0]:   File "/usr/local/lib/python3.10/dist-packages/lighteval/models/nanotron_model.py", line 1137, in greedy_until
0: [rank0]:     max_gen = max(item[1].generation_size for item in dataset)
0: [rank0]:   File "/usr/local/lib/python3.10/dist-packages/lighteval/models/nanotron_model.py", line 1137, in <genexpr>
0: [rank0]:     max_gen = max(item[1].generation_size for item in dataset)
0: [rank0]: TypeError: 'GreedyUntilRequest' object is not subscriptable

There is a bug in max_gen = max(item[1].generation_size for item in dataset) because dataset is GenerativeTaskDatasetNanotron whose __iter__() yields items directly without the index. This PR works around the issue in greedy_until() for the nanotron model.

Copy link
Member

@clefourrier clefourrier left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@clefourrier clefourrier merged commit 2f03df0 into huggingface:main Nov 8, 2024
2 checks passed
JoelNiklaus pushed a commit to JoelNiklaus/lighteval that referenced this pull request Nov 11, 2024
Co-authored-by: Nathan Habib <30601243+NathanHB@users.noreply.github.com>
Co-authored-by: Clémentine Fourrier <22726840+clefourrier@users.noreply.github.com>
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.

3 participants