Closed EnchantedAI closed 5 months ago
version is not compatible
So resolved?
I resolve it by uninstalling torch and installing torce 2.2.1 in colab. !pip3 uninstall --yes torch torchaudio torchvision torchtext torchdata !pip install torch==2.2.1 torchaudio torchvision torchtext torchdata
So resolved?
Yes,colab seems to have a wrong pytorch version, I resolved it by reinstalling torch 2.2.1
Wait for torch 2.3, use the new method:
%%capture
# Installs Unsloth, Xformers (Flash Attention) and all other packages!
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
!pip install --no-deps xformers trl peft accelerate bitsandbytes
when execute “from unsloth import FastLanguageModel” Runtime error:Failed to import transformers.integrations.peft because of the following error (look up to see its traceback): module 'torch._functorch.eager_transforms' has no attribute 'grad_and_value' All error description:
AttributeError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name) 1535 return importlib.import_module("." + module_name, self.name) 1536 except Exception as e: -> 1537 raise RuntimeError( 1538 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its" 1539 f" traceback):\n{e}"
RuntimeError: Failed to import transformers.integrations.peft because of the following error (look up to see its traceback): module 'torch._functorch.eager_transforms' has no attribute 'grad_and_value'