Skip to content

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 <[email protected]>
Co-authored-by: Clémentine Fourrier <[email protected]>
hynky1999 pushed a commit that referenced this pull request Nov 29, 2024
Co-authored-by: Nathan Habib <[email protected]>
Co-authored-by: Clémentine Fourrier <[email protected]>
hynky1999 pushed a commit that referenced this pull request May 22, 2025
Co-authored-by: Nathan Habib <[email protected]>
Co-authored-by: Clémentine Fourrier <[email protected]>
hynky1999 pushed a commit that referenced this pull request May 22, 2025
Co-authored-by: Nathan Habib <[email protected]>
Co-authored-by: Clémentine Fourrier <[email protected]>
NathanHB added a commit that referenced this pull request Sep 19, 2025
Co-authored-by: Nathan Habib <[email protected]>
Co-authored-by: Clémentine Fourrier <[email protected]>
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