Uh oh!
There was an error while loading. Please reload this page.
[bitsandbbytes] follow-ups - #9730
Conversation
HuggingFaceDocBuilderDev
commented
Oct 21, 2024
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
| """ | ||
| checks if the quantized param has expected shape. | ||
| """ | ||
| if not hasattr(self, "check_quantized_param_shape"): |
There was a problem hiding this comment.
Think this should be?
| ifnothasattr(self, "check_quantized_param_shape"): | |
| ifnothasattr(self, "check_if_quantized_param"):: |
There was a problem hiding this comment.
The method is checking for itself? That can't be the case right? Because the subclass inherits it? So it should already be in there?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| quantization_config=quantization_config | ||
| ) | ||
| ``` | ||
| Once a model is quantized, you can push the model to the Hub with the [`~ModelMixin.push_to_hub`] method. The quantization `config.json` file is pushed first, followed by the quantized model weights. You can also save the serialized 4-bit models locally with [`~ModelMixin.save_pretrained`]. |
There was a problem hiding this comment.
To unify the content between 8bit and 4bit hfoption.
| and hf_quantizer.check_if_quantized_param(model, param, param_name, state_dict, param_device=device) | ||
| ): | ||
| hf_quantizer.check_quantized_param_shape(param_name, empty_state_dict[param_name].shape, param.shape) | ||
| elif not is_quant_method_bnb: |
There was a problem hiding this comment.
Could have done with else but I think it's a tad bit safer.
* bnb follow ups. * add a warning when dtypes mismatch. * fx-copies * clear cache. * check_if_quantized_param * add a check on shape. * updates * docs * improve readability. * resources. * fix
What does this PR do?
bitsandbytes#9213 (comment)hf-internal-testing