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 a argument error #1501

Merged
merged 2 commits into from
Nov 2, 2023
Merged

Conversation

ranchlai
Copy link
Contributor

@ranchlai ranchlai commented Nov 1, 2023

What does this PR do?

This PR fixes the error when pad_token_id is set ( in order to user batch size > 1).

>>>  File "optimum/optimum/gptq/data.py", line 57, in <listcomp>
collate_data(new_examples[start : start + batch_size], pad_token_id)
  File "optimum/optimum/gptq/data.py", line 88, in collate_data
    label_blocks = [block["labels"] for block in blocks]
  File "optimum/optimum/gptq/data.py", line 88, in <listcomp>
    label_blocks = [block["labels"] for block in blocks]
KeyError: 'labels'

@SunMarc Please have a look

@ranchlai
Copy link
Contributor Author

ranchlai commented Nov 1, 2023

I just noticed that there is already an issue here #1447 .

Copy link
Member

@SunMarc SunMarc 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 for the fix !

@SunMarc SunMarc requested a review from fxmarty November 1, 2023 16:40
Copy link
Contributor

@fxmarty fxmarty left a comment

Choose a reason for hiding this comment

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

LGTM

@fxmarty
Copy link
Contributor

fxmarty commented Nov 2, 2023

@ranchlai? Before merging, could you run make style? I don't have push permission to your branch unfortunately.

@ranchlai
Copy link
Contributor Author

ranchlai commented Nov 2, 2023

Sure. I have done that. This will reformat anther file though. @fxmarty

@fxmarty fxmarty merged commit 3676fbc into huggingface:main Nov 2, 2023
48 of 52 checks passed
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