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

transformers 4.38.2不支持starcoder2的加载 #2762

Closed
1 task done
zailegezai opened this issue Mar 9, 2024 · 7 comments
Closed
1 task done

transformers 4.38.2不支持starcoder2的加载 #2762

zailegezai opened this issue Mar 9, 2024 · 7 comments
Labels
solved This problem has been already solved

Comments

@zailegezai
Copy link

Reminder

  • I have read the README and searched the existing issues.

Reproduction

torchrun --nnodes 1 --master_port 25000 --nproc_per_node 8 src/train_bash.py
--stage sft
--do_train
--model_name_or_path /home/starcoder2-7b/
--dataset alpaca_zh
--template default
--finetuning_type lora
--lora_target q_proj,v_proj
--output_dir out/starcoder2
--overwrite_cache
--per_device_train_batch_size 4
--gradient_accumulation_steps 4
--lr_scheduler_type cosine
--logging_steps 10
--save_steps 1000
--learning_rate 5e-5
--num_train_epochs 3.0
--plot_loss
--fp16
--ddp_find_unused_parameters False
--ddp_timeout 30000
--deepspeed /opt/third_party/LLaMA-Factory/scripts/zero2.json

Expected behavior

Traceback (most recent call last):
File "src/train_bash.py", line 14, in
main()
File "src/train_bash.py", line 5, in main
run_exp()
File "/opt/third_party/LLaMA-Factory/src/llmtuner/train/tuner.py", line 32, in run_exp
run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
File "/opt/third_party/LLaMA-Factory/src/llmtuner/train/sft/workflow.py", line 34, in run_sft
model = load_model(tokenizer, model_args, finetuning_args, training_args.do_train)
File "/opt/third_party/LLaMA-Factory/src/llmtuner/model/loader.py", line 63, in load_model
config = AutoConfig.from_pretrained(model_args.model_name_or_path, **init_kwargs)
File "/usr/local/lib/python3.8/dist-packages/transformers/models/auto/configuration_auto.py", line 1130, in from_pretrained
raise ValueError(
ValueError: The checkpoint you are trying to load has model type starcoder2 but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

System Info

No response

Others

No response

@hiyouga
Copy link
Owner

hiyouga commented Mar 9, 2024

@hiyouga hiyouga added the solved This problem has been already solved label Mar 9, 2024
@hiyouga hiyouga closed this as completed Mar 9, 2024
@ponyyue
Copy link

ponyyue commented Mar 11, 2024

想问下题主问题解决了吗?
我这里install后报错 ImportError: cannot import name 'top_k_top_p_filtering' from 'transformers' (/root/miniconda3/lib/python3.8/site-packages/transformers/init.py)
有遇到类似的问题吗?

@Yu-Yang-Li
Copy link

同样问题

@hiyouga
Copy link
Owner

hiyouga commented Mar 12, 2024

需要升级到 4.39.0.dev0

@Yu-Yang-Li
Copy link

您好,更新后还是会存在这个问题,按trl的issue修改后也是会有类似错误
image

@hiyouga
Copy link
Owner

hiyouga commented Mar 12, 2024

按照这个修改了么 huggingface/trl#1415

@Yu-Yang-Li
Copy link

运行成功了 感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

No branches or pull requests

4 participants