You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original BLIP2-OPT-6.7B model takes more than 30GB RAM to load and convert. So I want to save the compressed model then load it directly from another PC with limited RAM. The saving succeeded. But loading failed.
$ l optimized-blip2
total 4.7G
drwxrwxr-x 2 wayne wayne 4.0K Apr 25 16:55 .
drwxrwxr-x 6 wayne wayne 4.0K Apr 26 08:40 ..
-rw-rw-r-- 1 wayne wayne 42 Apr 25 16:54 bigdl_config.json
-rw-rw-r-- 1 wayne wayne 942 Apr 25 16:53 config.json
-rw-rw-r-- 1 wayne wayne 136 Apr 25 16:53 generation_config.json
-rw-rw-r-- 1 wayne wayne 446K Apr 25 16:55 merges.txt
-rw-rw-r-- 1 wayne wayne 4.7G Apr 25 16:54 model.safetensors
-rw-rw-r-- 1 wayne wayne 432 Apr 25 16:55 preprocessor_config.json
-rw-rw-r-- 1 wayne wayne 548 Apr 25 16:55 special_tokens_map.json
-rw-rw-r-- 1 wayne wayne 708 Apr 25 16:55 tokenizer_config.json
-rw-rw-r-- 1 wayne wayne 2.1M Apr 25 16:55 tokenizer.json
-rw-rw-r-- 1 wayne wayne 780K Apr 25 16:55 vocab.json
copied_model=load_low_bit(copied_model, model_path)
2024-04-2608:39:58,752-INFO-Convertingthecurrentmodeltosym_int4format......
2024-04-2608:39:59,115-ERROR-****************************UsageError************************Errornofilenamedpytorch_model.binfoundindirectoryoptimized-blip2.
2024-04-2608:39:59,116-ERROR-****************************CallStack*************************---------------------------------------------------------------------------RuntimeErrorTraceback (mostrecentcalllast)
CellIn[19], line1---->1copied_model=load_low_bit(copied_model, 'optimized-blip2')
File [~/.env/ipex-llm/lib/python3.10/site-packages/ipex_llm/optimize.py:178](http://case-wlc-01.sh.intel.com:8888/home/wayne/.env/ipex-llm/lib/python3.10/site-packages/ipex_llm/optimize.py#line=177), in load_low_bit(model, model_path)175qtype=ggml_tensor_qtype[low_bit]
176model=ggml_convert_low_bit(model, qtype=qtype, convert_shape_only=True)
-->178resolved_archive_file, is_sharded=extract_local_archive_file(model_path, subfolder="")
179ifis_sharded:
180# For now only shards transformers models181# can run in this branch.182resolved_archive_file, _= \
183get_local_shard_files(model_path,
184resolved_archive_file,
185subfolder="")
File [~/.env/ipex-llm/lib/python3.10/site-packages/ipex_llm/transformers/utils.py:83](http://case-wlc-01.sh.intel.com:8888/home/wayne/.env/ipex-llm/lib/python3.10/site-packages/ipex_llm/transformers/utils.py#line=82), in extract_local_archive_file(pretrained_model_name_or_path, subfolder, variant)81returnarchive_file, is_sharded82else:
--->83invalidInputError(False,
84f"Error no file named {_add_variant(WEIGHTS_NAME, variant)}"85" found in directory"86f" {pretrained_model_name_or_path}.")
File [~/.env/ipex-llm/lib/python3.10/site-packages/ipex_llm/utils/common/log4Error.py:32](http://case-wlc-01.sh.intel.com:8888/home/wayne/.env/ipex-llm/lib/python3.10/site-packages/ipex_llm/utils/common/log4Error.py#line=31), in invalidInputError(condition, errMsg, fixMsg)30ifnotcondition:
31outputUserMessage(errMsg, fixMsg)
--->32raiseRuntimeError(errMsg)
RuntimeError: Errornofilenamedpytorch_model.binfoundindirectoryoptimized-blip2.
The text was updated successfully, but these errors were encountered:
You might want to verify that the model you downloaded is complete. And note that you should download the original pytorch_model.
As for loading converted model, I use the following code:
arda@arda-arc05:/mnt/disk1/models$ python blip2.py
/opt/anaconda3/envs/mingyu-llm-gpu/lib/python3.11/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source? warn(2024-04-29 10:47:15,896 - INFO - intel_extension_for_pytorch auto imported2024-04-29 10:47:16,064 - INFO - Converting the current model to sym_int4 format......Model loaded successfully!
The original BLIP2-OPT-6.7B model takes more than 30GB RAM to load and convert. So I want to save the compressed model then load it directly from another PC with limited RAM. The saving succeeded. But loading failed.
$ l optimized-blip2 total 4.7G drwxrwxr-x 2 wayne wayne 4.0K Apr 25 16:55 . drwxrwxr-x 6 wayne wayne 4.0K Apr 26 08:40 .. -rw-rw-r-- 1 wayne wayne 42 Apr 25 16:54 bigdl_config.json -rw-rw-r-- 1 wayne wayne 942 Apr 25 16:53 config.json -rw-rw-r-- 1 wayne wayne 136 Apr 25 16:53 generation_config.json -rw-rw-r-- 1 wayne wayne 446K Apr 25 16:55 merges.txt -rw-rw-r-- 1 wayne wayne 4.7G Apr 25 16:54 model.safetensors -rw-rw-r-- 1 wayne wayne 432 Apr 25 16:55 preprocessor_config.json -rw-rw-r-- 1 wayne wayne 548 Apr 25 16:55 special_tokens_map.json -rw-rw-r-- 1 wayne wayne 708 Apr 25 16:55 tokenizer_config.json -rw-rw-r-- 1 wayne wayne 2.1M Apr 25 16:55 tokenizer.json -rw-rw-r-- 1 wayne wayne 780K Apr 25 16:55 vocab.json
The text was updated successfully, but these errors were encountered: