this error appeared while I’m working on the llava model and this is the used code:
!python /content/LLaVA/llava/eval/run_llava.py –model-path /content/drive/MyDrive/dataset/checkpoints/llavanew-2-7b-chat-task-lora
–model-base /content/llava-v1.5-7b
–image-file /content/drive/MyDrive/dataset/images/0.jpg
–query “here is a basic caption of an image:{woman wearing a headband } give me more detailed caption:”
and this is the output screenshot and at last the error appeared:
2024-07-30 16:16:30.584912: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-07-30 16:16:30.584966: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-07-30 16:16:30.586500: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-07-30 16:16:31.682260: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Loading LLaVA from base model…
/usr/local/lib/python3.10/dist-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(
Loading checkpoint shards: 100% 2/2 [00:04<00:00, 2.32s/it]
Loading additional LLaVA weights…
Loading LoRA weights…
Merging LoRA weights…
/usr/local/lib/python3.10/dist-packages/peft/tuners/lora/bnb.py:336: UserWarning: Merge lora module to 4-bit linear may get different generations due to rounding errors.
warnings.warn(
Model is loaded…
Traceback (most recent call last):
File “/content/LLaVA/llava/eval/run_llava.py”, line 145, in
eval_model(args)
File “/content/LLaVA/llava/eval/run_llava.py”, line 115, in eval_model
output_ids = model.generate(
File “/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py”, line 115, in decorate_context
return func(*args, **kwargs)
File “/content/LLaVA/llava/model/language_model/llava_llama.py”, line 137, in generate
return super().generate(
File “/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py”, line 115, in decorate_context
return func(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py”, line 1525, in generate
return self.sample(
File “/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py”, line 2622, in sample
outputs = self(
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1520, in _call_impl
return forward_call(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/accelerate/hooks.py”, line 169, in new_forward
output = module._old_forward(*args, **kwargs)
File “/content/LLaVA/llava/model/language_model/llava_llama.py”, line 91, in forward
return super().forward(
File “/usr/local/lib/python3.10/dist-packages/transformers/models/llama/modeling_llama.py”, line 1201, in forward
logits = self.lm_head(hidden_states)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1520, in _call_impl
return forward_call(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/accelerate/hooks.py”, line 169, in new_forward
output = module._old_forward(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bitsandbytes/nn/modules.py”, line 455, in forward
assert self.weight.shape[1] == 1
AssertionError
I’ve tried to install the package using !pip install llama-cpp-python==0.1.78 and several changes in code but still the same error appears
could anyone who faces the same issue help?
Asma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.