Closed benjaminye closed 7 months ago
cc @younesbelkada
The easiest way to prevent this would be having explicit checks when performing post_init()
when instantiating BitsAndBytesConfig
:
load_in_8bit
and load_in_4bit
positional arguments is an instance of bool
would prevent arbitrary types being passed in.load_in_8bit
?I don't think there's a need to check for arguments in case when they are passed in as kwargs, i.e. BitsAndBytesConfig(**{"foo":"bar", "foo":"bar"})
. Maybe helpful warning would be nice?
Hi @benjaminye thanks for raising the issue! yes adding a warning makes sense, would you like to open a PR for that? Otherwise happy to do it!
Hi @younesbelkada, PR raised @ https://github.com/huggingface/transformers/pull/29761
Thanks so much !
Thanks everyone! This was a good first issue to work on 😄
System Info
transformers
version: 4.38.2Who can help?
@SunMarc @youn
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Module Imports
Define BitsAndBytesConfig
Load in Model with Quant Config
Model successfully loads without any error showing user that an invalid
BitsAndBytesConfig
was passed inExpected behavior
BitsAndBytesConfig
, resulting in users able to pass in arbitrary parameters without realizingBitsAndBytesConfig
should throw and error when invalid config is encountererd.