modelscope / ms-swift

Use PEFT or Full-parameter to finetune 400+ LLMs or 100+ MLLMs. (LLM: Qwen2.5, Llama3.2, GLM4, Internlm2.5, Yi1.5, Mistral, Baichuan2, DeepSeek, Gemma2, ...; MLLM: Qwen2-VL, Qwen2-Audio, Llama3.2-Vision, Llava, InternVL2, MiniCPM-V-2.6, GLM4v, Xcomposer2.5, Yi-VL, DeepSeek-VL, Phi3.5-Vision, ...)
https://swift.readthedocs.io/zh-cn/latest/Instruction/index.html
Apache License 2.0
4.34k stars 381 forks source link

Checkpoint model error #2459

Closed BurakYildizak closed 6 hours ago

BurakYildizak commented 1 week ago

I fine tuned qwen2_vl model for ocr system. I would like predict for one image. I get this error."Can't instantiate a processor, a tokenizer, an image processor or a feature extractor for this model. Make sure the repository contains the files of at least one of those processing classes" File content is as: Screenshot 2024-11-15 152455

I give error this line code model, tokenizer = get_model_tokenizer(model_type, model_kwargs={'device_map': 'auto'},model_id_or_path=ckpt_dir)

How ı can solution this problem?

Thank you everyone

Jintao-Huang commented 6 days ago

https://github.com/modelscope/ms-swift/issues/839

please use Swift.from_pretrained. This is just the LoRA incremental weights.

BurakYildizak commented 6 hours ago

I resolved it. Thank you

Cheers