intel / intel-extension-for-transformers

⚡ Build your chatbot within minutes on your favorite device; offer SOTA compression techniques for LLMs; run LLMs efficiently on Intel Platforms⚡
Apache License 2.0
2.13k stars 211 forks source link

environment problem in qat for stable diffusion #1093

Closed Sugar929 closed 4 months ago

Sugar929 commented 10 months ago

I followed

pip install intel-extension-for-transformers
pip install -r requirements.txt
pip install transformers==4.34.1

but there exists hugging-face version conflict, and I checked dependabot's advice(#981) upgrade transformers version to 4.36.0. It threw an error like

loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
  File "/home/miniconda3/envs/qat/lib/python3.9/site-packages/transformers/modeling_utils.py", line 2863, in from_pretrained
    raise ImportError(
ImportError: Using `low_cpu_mem_usage=True` or a `device_map` requires Accelerate: `pip install accelerate`

it seems a problem from transformers, what's the right way to create the environment?

changwangss commented 10 months ago

https://github.com/intel/intel-extension-for-transformers/blob/main/examples/huggingface/pytorch/text-to-image/quantization/qat/requirements.txt please install the requirements.txt under the qat example folder, the accelerate is necessary in the requirements.txt, but the error message showed the env missed the package, the transformers version 4.34.1 is validated.