Some modules are dispatched on the CPU or the disk
Using the example in git repository and procesing sales.png i got this message:
Unused kwargs: ['_load_in_4bit', '_load_in_8bit', 'quant_method']. These kwargs are not used in <class 'transformers.utils.quantization_config.BitsAndBytesConfig'>.
Traceback (most recent call last):
File "D:\Dev\PY\3ML\prueba_3ML.py", line 10, in
model = AutoModelForCausalLM.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Dev\PY\3ML\env\Lib\site-packages\transformers\models\auto\auto_factory.py", line 559, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Dev\PY\3ML\env\Lib\site-packages\transformers\modeling_utils.py", line 4207, in from_pretrained
hf_quantizer.validate_environment(device_map=device_map)
File "D:\Dev\PY\3ML\env\Lib\site-packages\transformers\quantizers\quantizer_bnb_4bit.py", line 102, in validate_environment
raise ValueError(
ValueError: Some modules are dispatched on the CPU or the disk. Make sure you have enough GPU RAM to fit the quantized model. If you want to dispatch the model on the CPU or the disk while keeping these modules in 32-bit, you need to set llm_int8_enable_fp32_cpu_offload=True
and pass a custom device_map
to from_pretrained
. Check https://huggingface.co/docs/transformers/main/en/main_classes/quantization#offload-between-cpu-and-gpu for more details.