DB-GPT-Hub icon indicating copy to clipboard operation
DB-GPT-Hub copied to clipboard

The issue of mixing get_args() and transformers.HfArgumentParser()

Open Chopinxb opened this issue 1 year ago • 4 comments

command:

CUDA_VISIBLE_DEVICES=2 python ./predict_lora.py --base_model_name_or_path /models/Baichuan-13B-Chat --peft_ckpt_path /home/chopin/finetune_model/baichuan-13b_ft2 --output_name ./data/out_pred/pre_lora_spider_schema.sql

errors:

[2023-08-15 15:01:58,636] [INFO] [real_accelerator.py:133:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Traceback (most recent call last):
  File "/home/chopin/code/DB-GPT-Hub/./predict_lora.py", line 186, in <module>
    result = predict()
  File "/home/chopin/code/DB-GPT-Hub/./predict_lora.py", line 62, in predict
    model_server_args, generation_args = parser.parse_args_into_dataclasses()
  File "/home/chopin/miniconda3/envs/ft/lib/python3.10/site-packages/transformers/hf_argparser.py", line 347, in parse_args_into_dataclasses
    raise ValueError(f"Some specified arguments are not used by the HfArgumentParser: {remaining_args}")
ValueError: Some specified arguments are not used by the HfArgumentParser: ['--base_model_name_or_path', '/models/Baichuan-13B-Chat', '--peft_ckpt_path', '/home/chopin/finetune_model/baichuan-13b_ft2', '--output_name', './data/out_pred/pre_lora_spider_schema.sql']

Chopinxb avatar Aug 15 '23 07:08 Chopinxb

the same issue

xiaoningli92 avatar Aug 24 '23 07:08 xiaoningli92

+1, Have you resolved it?

pengwei1024 avatar Sep 01 '23 07:09 pengwei1024

已解决,不要在 predict_lora.py 后面增加 --peft_ckpt_path 这些参数,改到代码里面的 default 就好了,算临时绕过去了吧

pengwei1024 avatar Sep 01 '23 08:09 pengwei1024

change https://github.com/eosphoros-ai/DB-GPT-Hub/blob/main/predict_lora.py#L62 to: model_server_args, generation_args, _ = parser.parse_args_into_dataclasses(return_remaining_strings=True)

seems the parse_args_into_dataclasses is not compatible.

hushiwen26 avatar Sep 04 '23 03:09 hushiwen26