Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LLAVA example on CPU #11271

Merged
merged 4 commits into from
Jun 26, 2024
Merged

Fix LLAVA example on CPU #11271

merged 4 commits into from
Jun 26, 2024

Conversation

jenniew
Copy link
Contributor

@jenniew jenniew commented Jun 10, 2024

Fix LLAVA example issue on CPU.
Related issue: #11230

@jenniew jenniew requested a review from Ricky-Ting June 10, 2024 17:13
@Oscilloscope98 Oscilloscope98 removed the request for review from Ricky-Ting June 14, 2024 02:50
@JinBridger
Copy link
Member

JinBridger commented Jun 14, 2024

On linux it works fine. But on Windows, it throws following error:

platform: xiaoxin03
ipex-llm version: 2.1.0b20240613

(jinqiao-llm-0614) D:\jinqiao>python generate.py --repo-id-or-model-path D:/llm-models/llava-v1.5-7b --image-path-or-url https://llava-vl.github.io/static/images/monalisa.jpg
C:\Users\arda\miniforge3\envs\jinqiao-llm-0614\Lib\site-packages\bitsandbytes\cextension.py:34: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers, 8-bit multiplication, and GPU quantization are unavailable.
  warn("The installed version of bitsandbytes was compiled without GPU support. "
'NoneType' object has no attribute 'cadam32bit_grad_fp32'
You are using a model of type llava to instantiate a model of type llava_llama. This is not supported for all configurations of models and can yield errors.
C:\Users\arda\miniforge3\envs\jinqiao-llm-0614\Lib\site-packages\huggingface_hub\file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Traceback (most recent call last):
  File "D:\jinqiao\generate.py", line 292, in <module>
    tokenizer, model, image_processor, _ = load_pretrained_model(model_path=model_path,
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\jinqiao\generate.py", line 154, in load_pretrained_model
    model = LlavaLlamaForCausalLM.from_pretrained(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\arda\miniforge3\envs\jinqiao-llm-0614\Lib\site-packages\transformers\modeling_utils.py", line 3706, in from_pretrained
    ) = cls._load_pretrained_model(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\arda\miniforge3\envs\jinqiao-llm-0614\Lib\site-packages\transformers\modeling_utils.py", line 3835, in _load_pretrained_model
    raise ValueError(
ValueError: The current `device_map` had weights offloaded to the disk. Please provide an `offload_folder` for them. Alternatively, make sure you have `safetensors` installed if the model you are using offers the weights in this format.

By changing here to kwargs = {} it works well again on Windows.

@jenniew jenniew requested a review from JinBridger June 24, 2024 07:22
@jenniew jenniew merged commit 40fa235 into intel-analytics:main Jun 26, 2024
30 of 31 checks passed
RyuKosei pushed a commit to RyuKosei/ipex-llm that referenced this pull request Jul 19, 2024
* update

* update

* update

* update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants