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

New llama-factory code runs into batch["input_ids"] is None. The old version is ok. #3463

Closed
1 task done
hnhoangdz opened this issue Apr 26, 2024 · 1 comment
Closed
1 task done
Labels
invalid This doesn't seem right

Comments

@hnhoangdz
Copy link

Reminder

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

Reproduction

Traceback (most recent call last):
File "/root/LLaMA-Factory/src/train_bash.py", line 14, in
main()
File "/root/LLaMA-Factory/src/train_bash.py", line 5, in main
run_exp()
File "/root/LLaMA-Factory/src/llmtuner/train/tuner.py", line 31, in run_exp
run_pt(model_args, data_args, training_args, finetuning_args, callbacks)
File "/root/LLaMA-Factory/src/llmtuner/train/pt/workflow.py", line 47, in run_pt
train_result = trainer.train(resume_from_checkpoint=training_args.resume_from_checkpoint)
File "/root/anaconda3/envs/llama_factory/lib/python3.10/site-packages/transformers/trainer.py", line 1780, in train
return inner_training_loop(
File "/root/anaconda3/envs/llama_factory/lib/python3.10/site-packages/transformers/trainer.py", line 1843, in _inner_training_loop
num_train_tokens = self.num_tokens(train_dataloader) * args.num_train_epochs
File "/root/anaconda3/envs/llama_factory/lib/python3.10/site-packages/transformers/trainer.py", line 1360, in num_tokens
tokens = batch["input_ids"].numel()
TypeError: 'NoneType' object is not subscriptable

Expected behavior

No response

System Info

No response

Others

No response

@hnhoangdz hnhoangdz changed the title New llama-factory code runs into batch["input_ids"] is None. The old old version is ok. New llama-factory code runs into batch["input_ids"] is None. The old version is ok. Apr 26, 2024
@hiyouga hiyouga added the pending This problem is yet to be addressed. label Apr 26, 2024
@hiyouga
Copy link
Owner

hiyouga commented Apr 26, 2024

please provide your training script for reproducing

@hiyouga hiyouga added invalid This doesn't seem right and removed pending This problem is yet to be addressed. labels Apr 29, 2024
@hiyouga hiyouga closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants