An error i ve been trying to fix for days now

Hi, I have been working with a code that downloads a model from the huggin face (you only specify its name) and then tunes it, trains it and evaluates. Everything seems fine up to the moment when the code actaully starts dowloading the model, this below error appears. I have been trying to download “unsloth/gemma-2b-it-bnb-4b” but I have the same problem with other models.
I have a correct transformers version, same wtih Bitsandbytes, this gemma model also has a config.json file. I am really lost here so any help is higly appreciated

1 Like

Hmm, I think it’s a problem with bitsandbytes, but the error content is different from these.
I just need to know the outline of the code in the loading section. Around from_pretrained and quantization_config.

Hi thank you so much for help!

Possibly bitsandbytes could be an issue, but i am not sure how since i downloaded the version specified in requirements from the og repo.

the code is from this repository: https://github.com/kdu4108/context-vs-prior-finetuning and i think the code you refer to is in utils.py but I am not sure. Lmk if thats what you meant?

the line 98:

1 Like

I see, it was the code in the library. I think I’ve found the cause. If you don’t pass both load_in_4bit=True and load_in_8bit=True to load_model_and_tokenizer(), quantization_config=None will be set, and the above error will occur.
This should be avoided by the library.

Thanks for pointing things out! I actually lacked on of the argument that should have been passed to the main.py function but everything works now. Cheers!

1 Like