sequences = pipeline(
âI liked âBreaking Badâ and âBand of Brothersâ. Do you have any recommendations of other shows I might like?\nâ,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
max_length=200,
)
for seq in sequences:
print(f"Result: {seq[âgenerated_textâ]}")
ValueError: Could not load model meta-llama/Llama-2-7b-chat-hf with any of the following classes: (<class âtransformers.models.auto.modeling_auto.AutoModelForCausalLMâ>, <class âtransformers.models.auto.modeling_tf_auto.TFAutoModelForCausalLMâ>, <class âtransformers.models.llama.modeling_llama.LlamaForCausalLMâ>).
Hello, Iâm facing a similar issue running the 7b model using transformer pipelines as itâs outlined in this blog post. Hopefully there will be a fix soon.
Hey all! I was able to reproduce the error you have when using only CPU in Google Colab. After switching to GPU-powered Colab (even free, T4), things work properly.
It turns out there was a bug in Accelerate which has now been fixed.
Make sure to do pip install -U git+https://github.com/huggingface/accelerate.git if youâre running on CPU. But itâs advised to run on at least one GPU.
now a new error \torch\nn\modules\linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: âaddmm_impl_cpu_â not implemented for âHalfâ
I updated accelerate and now I get the following error:
RuntimeError: MPS does not support cumsum op with int64 input
I also get the suggestion to install xformers, but that doesnât work either. I get the error:
Backend subprocess exited when trying to invoke get_requires_for_build_wheel
Traceback (most recent call last):
File "/opt/homebrew/Cellar/poetry/1.5.1/libexec/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/opt/homebrew/Cellar/poetry/1.5.1/libexec/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/poetry/1.5.1/libexec/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/y6/skpcb0d11fb0yknzv6934h480000gn/T/tmpp_eso2ta/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/y6/skpcb0d11fb0yknzv6934h480000gn/T/tmpp_eso2ta/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/private/var/folders/y6/skpcb0d11fb0yknzv6934h480000gn/T/tmpp_eso2ta/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 488, in run_setup
self).run_setup(setup_script=setup_script)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/y6/skpcb0d11fb0yknzv6934h480000gn/T/tmpp_eso2ta/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 23, in <module>
ModuleNotFoundError: No module named 'torch'
at /opt/homebrew/Cellar/poetry/1.5.1/libexec/lib/python3.11/site-packages/poetry/installation/chef.py:147 in _prepare
143â
144â error = ChefBuildError("\n\n".join(message_parts))
145â
146â if error is not None:
â 147â raise error from None
148â
149â return path
150â
151â def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with xformers (0.0.20) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "xformers (==0.0.20)"'.
I was able to fix the error: RuntimeError: MPS does not support cumsum op with int64 input
by running the following command: pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
I got the same issue and solved it by releasing more VRAM for it. So, it seems there could be multiple reasons under the hood for this error. Not enough disk space, not enough GPU memory, PyTorch not installed etc. ⌠j
poetry env use ~/.pyenv/versions/3.9.13/bin/python3 # Pinning this version due to [1]
poetry lock
poetry install
Then, when running poetry run python tutorial_test.py I get the error RuntimeError: MPS does not support cumsum op with int64 input.
I tried to switch to a nightly build of torch by running poetry add --source pytorch-night torch torchvision torchaudio. But I get the following error:
I had the same problem, the only way I was able to fix it was instead to use the CUDA version of torch (the preview Nightly with CUDA 12.1 worked with my 12.2). If you use the GPU you are able to prevent this issue and follow up issues after installing xformers, which leads me to believe that perhaps using the CPU for this is just not viable.
Do we already have a solution for this issue? I was able to run the llama-2-13b-chat-hf for a week or so. But for some reason, I got this error today that the model canât be loaded. I didnât change anything in the code or the virtual env though.
ValueError: Could not load model meta-llama/Llama-2-13b-chat-hf with any of the following classes: (<class âtransformers.models.auto.modeling_auto.AutoModelForCausalLMâ>, <class âtransformers.models.llama.modeling_llama.LlamaForCausalLMâ>).