Old torch versions

This commit is contained in:
Daniel Han 2024-11-26 00:26:37 -08:00
commit 7321fe9b79
2 changed files with 12 additions and 0 deletions

View file

@ -1131,6 +1131,16 @@ def unsloth_compile_transformers(
disable = False,
return_logits = False,
):
if Version(torch_version) < Version("2.4.0"):
print(
"="*30 + \
"Unsloth: Unfortunately Unsloth vision and other newer optimized models need Torch 2.4 or later.\n"\
f"You have Torch version {torch_version}. Please upgrade your Torch version by visiting https://pytorch.org/\n"\
"For now your models will not get optimized, but will still work for now!"
)
return
pass
if disable: return
model_types = get_transformers_model_type(
model_name = model_name,

View file

@ -401,6 +401,7 @@ class FastVisionModel(FastBaseVisionModel):
revision = revision,
trust_remote_code = trust_remote_code,
)
print("Model config", model_config)
is_model = True
except Exception as error:
autoconfig_error = str(error)
@ -412,6 +413,7 @@ class FastVisionModel(FastBaseVisionModel):
revision = revision,
trust_remote_code = trust_remote_code,
)
print("PEFT config", peft_config)
is_peft = True
except Exception as error:
peft_error = str(error)