Skip to content

QwenVL model Local train, save lora success, but convert to float16 Error #2013

@edhh-hh

Description

@edhh-hh

Platform:
Ubuntu 18.04.6 LTS

Env:
python-version: 3.11.11
Unsloth 2025.3.9: Fast Qwen2_5_Vl patching. Transformers: 4.49.0.
Platform: Linux.
Torch: 2.4.0+cu118. CUDA Toolkit: 11.8. Triton: 3.0.0
Bfloat16 = FALSE. FA [Xformers = 0.0.27.post2+cu118. FA2 = False]

I try to do fine-tune Qwen2.5 VL 7B like this: https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen2_VL_(7B)-Vision.ipynb

But I have to do it offline.
So i mannally download all the file from “unsloth/Qwen2.5-VL-7B-Instruct-unsloth-bnb-4bit”
and save it in a folder, load it like:

model, tokenizer = FastVisionModel.from_pretrained(
model_path,
load_in_4bit=True,
use_gradient_checkpointing="unsloth",
local_files_only=True,
)

where model_path is where i store the files from hugging face.
training and saving lora works perfectly, but when I try to 'Saving to float16 for VLLM' just like notebook, i got the following error:

model.save_pretrained_merged("Qwen25_model", tokenizer, save_method="merged_16bit")


HFValidationError Traceback (most recent call last)
File ~/anaconda3/envs/usl39118/lib/python3.11/site-packages/huggingface_hub/hf_file_system.py:125, in HfFileSystem._repo_and_revision_exist(self, repo_type, repo_id, revision)
124 try:
--> 125 self._api.repo_info(
126 repo_id, revision=revision, repo_type=repo_type, timeout=constants.HF_HUB_ETAG_TIMEOUT
127 )
128 except (RepositoryNotFoundError, HFValidationError) as e:

File ~/anaconda3/envs/usl39118/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py:106, in validate_hf_hub_args.._inner_fn(*args, **kwargs)
105 if arg_name in ["repo_id", "from_id", "to_id"]:
--> 106 validate_repo_id(arg_value)
108 elif arg_name == "token" and arg_value is not None:

File ~/anaconda3/envs/usl39118/lib/python3.11/site-packages/huggingface_hub/utils/validators.py:160, in validate_repo_id(repo_id)
159 if not REPO_ID_REGEX.match(repo_id):
--> 160 raise HFValidationError(
161 "Repo id must use alphanumeric chars or '-', '
', '.', '--' and '..' are"
162 " forbidden, '-' and '.' cannot start or end the name, max length is 96:"
163 f" '{repo_id}'."
164 )
166 if "--" in repo_id or ".." in repo_id:

HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: '/mnt'.
...
1134 elif isinstance(err, HFValidationError):
1135 msg = f"{path} (invalid repository id)"
-> 1136 raise FileNotFoundError(msg) from err

FileNotFoundError: /mnt/public/gggg/wwww/Model/Qwen25VL (invalid repository id)
`

when I perform the same operation in colab, it seems like it trys to download the 5 safetensor file seems like not quantized version of Qwen-2.5-VL.
if I want to perform this convert to float16 completely local, what should I do?
Any help would be appreciated!
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions