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 for fields being lists #563

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevelaskaridis
Copy link

Description

This fixes an error happening with TheBloke/stablelm-zephyr-3b-GPTQ model where certain fields are single element lists.

How to test

I tested it through lm-eval on arc-challenge:

lm-eval --model hf --model_args pretrained=TheBloke/stablelm-zephyr-3b-GPTQ,trust_remote_code=True,autogptq=model.safetensors,quantization_config={'bits':4} --tasks arc_challenge --device cuda:0 --batch_size auto --output /tmp/results/stablelm-zephyr-3b-GPTQ

@LaaZa
Copy link
Contributor

LaaZa commented Feb 23, 2024

Isn't that a mistake on @TheBloke s part? I don't think it makes sense for these values to be lists in the quantize_config.json

@TheBloke
Copy link
Contributor

TheBloke commented Feb 23, 2024

Yes sorry that was an error in my code for a little while. I thought I had fixed the repos that had that, but obviously not. Please don't PR AutoGPTQ for it

I've been away but will be back fairly soon and will fix any repos with that issue

In the meantime, the issue won't affect loading the model through Transformers (which uses config.json not quantize_config.json) - and that still uses AutoGPTQ as the backend

@stevelaskaridis
Copy link
Author

stevelaskaridis commented Feb 24, 2024

Yes, had a similar thought, but ultimately wasn't sure. Glad we have sorted this out.

In the meantime, people can use this branch in case they want to evaluate affected models.

Thanks, everyone!

Comment on lines +98 to +100
if isinstance(self.__dict__[check_field], list) and \
len(self.__dict__[check_field]) == 1:
self.__dict__[check_field] = self.__dict__[check_field][0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not use getattr(self, check_field)?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not really something that needs to be fixed in AutoGPTQ anyway. But I guess it's good to point out better patterns for their future code.

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.

None yet

4 participants