Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Please set --model <model_id_or_path>`, model: None #239

Open
rahulverma7788 opened this issue Dec 8, 2024 · 6 comments
Open

Comments

@rahulverma7788
Copy link

rahulverma7788 commented Dec 8, 2024

!swift sft
--model_type got-ocr2
--model_id_or_path stepfun-ai/GOT-OCR2_0
--sft_type lora
--dataset /kaggle/working/converted_dataset.json

run sh: /opt/conda/bin/python3.10 /kaggle/working/ms-swift/swift/cli/sft.py --model_type got-ocr2 --model_id_or_path stepfun-ai/GOT-OCR2_0 --sft_type lora --dataset /kaggle/working/converted_dataset.json

[INFO:swift] Successfully registered /kaggle/working/ms-swift/swift/llm/dataset/data/dataset_info.json
[INFO:swift] Successfully registered []
[INFO:swift] rank: -1, local_rank: -1, world_size: 1, local_world_size: 1
Traceback (most recent call last):
File "/kaggle/working/ms-swift/swift/cli/sft.py", line 5, in
sft_main()
File "/kaggle/working/ms-swift/swift/llm/train/sft.py", line 308, in sft_main
return SwiftSft(args).main()
File "/kaggle/working/ms-swift/swift/llm/train/sft.py", line 31, in init
super().init(args)
File "/kaggle/working/ms-swift/swift/llm/base.py", line 18, in init
self.args = self._parse_args(args)
File "/kaggle/working/ms-swift/swift/llm/base.py", line 27, in _parse_args
args, remaining_argv = parse_args(self.args_class, args)
File "/kaggle/working/ms-swift/swift/utils/utils.py", line 146, in parse_args
args, remaining_args = parser.parse_args_into_dataclasses(argv, return_remaining_strings=True)
File "/opt/conda/lib/python3.10/site-packages/transformers/hf_argparser.py", line 339, in parse_args_into_dataclasses
obj = dtype(**inputs)
File "", line 266, in init
File "/kaggle/working/ms-swift/swift/llm/argument/train_args.py", line 128, in post_init
BaseArguments.post_init(self)
File "/kaggle/working/ms-swift/swift/llm/argument/base_args/base_args.py", line 87, in post_init
ModelArguments.post_init(self)
File "/kaggle/working/ms-swift/swift/llm/argument/base_args/model_args.py", line 123, in post_init
raise ValueError(f'Please set --model <model_id_or_path>, model: {self.model}') ValueError: Please set --model <model_id_or_path>, model: None

getting error during fine tuning, in the past this was working without any issues.

@rahulverma7788
Copy link
Author

please help me.

@LukasDauterman
Copy link

I encountered this issue, it seems that there are undocumented changes in ms-swift here is what I had to do:

  • changed --model_id_or_path to --model

There was a following error with --sft_type not being recognized at its due to the arg name being changed in the arg class used to parse the args:

  • change --sft_type to --train_type

This has gotten me past the errors then it suggests running "pip install torchvision verovio" for GOT 2.0

@rahulverma7788
Copy link
Author

Thanks, i will check it. i have another question, model is taking long inference time after training, can i reduce it? have you any idea about it?

@LukasDauterman
Copy link

LukasDauterman commented Dec 11, 2024

Currently looking into that myself, I had found the vllm package did not work, and I am using the pt backend.

It looks like its runs all the inferences in a thread pool before it even outputs the results.

I think my solution for the time being is to make a small dataset to inference on, but then I need to figure out how to pass that to the inference script.

@LukasDauterman
Copy link

My work around was to write a jsonl with a handful of examples, then in the checkpoint args.json pointed the val_dataset to the new dataset.

@rahulverma7788
Copy link
Author

In my case, I am predicting image-to-LaTeX, where the image contains table data. After training, it is taking too much time during inference and is also not handling complex tables effectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants