Open belovedxixi opened 1 month ago
According to Hugging Face, this error is raised when torch.cuda.is_available() = False
. When torch.cuda.is_available() = False
, this means that torch
cannot find CUDA installed on your machine.
As you mentioned, it appears that Hugging Face requires that the machine that loads an AwqConfig
must have CUDA installed. Here are a couple of workaround options.
torch.cuda.is_available() = True
. Then run your command again.transformers
so that post_init()
is not called to avoid raising the error. Here are some steps to do this.
# 1) Uninstall existing `transformers` package
$ pip uninstall -y transformers
transformers
repo$ git clone https://github.com/huggingface/transformers
quantization_config.py
is in$ cd transformers/src/transformers/utils/
self.post_init()
in quantization_config.py
. Here's the location:#
transformers
from source$ cd ../../../ $ pip install -e .
Then run your command again.
@belovedxixi Did you try the above suggestions? Let us know how you went
Describe the bug Awq model export for cpu is not supported
To Reproduce python3 builder.py -i awq_model_dir -o output_folder -p int4 -e cpu -c cache_dir
Screenshots
Additional context It seems like hf 's file can not support awq_config for cpu