Remove version checks
This commit is contained in:
parent
83782024a0
commit
703699134e
2 changed files with 1 additions and 23 deletions
|
|
@ -62,10 +62,7 @@ from peft.tuners.lora import Linear4bit as Peft_Linear4bit
|
|||
from ..save import patch_saving_functions
|
||||
import re, os, inspect, math, sys
|
||||
from huggingface_hub.utils._token import get_token
|
||||
from transformers import __version__ as transformers_version
|
||||
from packaging.version import Version
|
||||
transformers_version = Version(transformers_version)
|
||||
SUPPORTS_LLAMA32 = transformers_version > Version("4.45.0")
|
||||
|
||||
|
||||
def original_apply_qkv(self, X):
|
||||
Q = self.q_proj(X)
|
||||
|
|
|
|||
|
|
@ -138,17 +138,6 @@ def get_model_name(model_name, load_in_4bit = True):
|
|||
pass
|
||||
|
||||
|
||||
LLAMA32_MODEL_NAMES = set((
|
||||
"unsloth/Llama-3.2-1B-bnb-4bit",
|
||||
"unsloth/Llama-3.2-3B-bnb-4bit",
|
||||
"unsloth/Llama-3.2-1B",
|
||||
"unsloth/Llama-3.2-3B",
|
||||
"unsloth/Llama-3.2-1B-Instruct-bnb-4bit",
|
||||
"unsloth/Llama-3.2-3B-Instruct-bnb-4bit",
|
||||
"unsloth/Llama-3.2-1B-Instruct",
|
||||
"unsloth/Llama-3.2-3B-Instruct",
|
||||
))
|
||||
|
||||
class FastLanguageModel(FastLlamaModel):
|
||||
@staticmethod
|
||||
def from_pretrained(
|
||||
|
|
@ -255,14 +244,6 @@ class FastLanguageModel(FastLlamaModel):
|
|||
f"to obtain the latest transformers build, then restart this session."\
|
||||
)
|
||||
|
||||
elif model_name.lower() in LLAMA32_MODEL_NAMES and not SUPPORTS_LLAMA32:
|
||||
raise ImportError(
|
||||
f"Unsloth: Your transformers version of {transformers_version} does not support Llama 3.2.\n"\
|
||||
f"The minimum required version is 4.46\n"\
|
||||
f'Try `pip install --upgrade "transformers>=4.46"`\n'\
|
||||
f"to obtain the latest transformers build, then restart this session."\
|
||||
)
|
||||
|
||||
dispatch_model = FastLlamaModel
|
||||
|
||||
elif model_type == "mistral": dispatch_model = FastMistralModel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue