I am trying to finetune LLama3.2 model and I did it successfully if I add the lines below:
trainer = train_on_responses_only(
trainer,
instruction_part = "<|start_header_id|>user<|end_header_id|>\n\n",
response_part = "<|start_header_id|>assistant<|end_header_id|>\n\n",
)
But if I remove those lines I get the error:
File "/workspace/ft.py", line 80, in
trainer_stats = trainer.train()
File "", line 142, in train
File "", line 363, in _fast_inner_training_loop
File "/usr/local/lib/python3.10/dist-packages/transformers/trainer.py", line 3318, in training_step
loss = self.compute_loss(model, inputs)
File "/usr/local/lib/python3.10/dist-packages/transformers/trainer.py", line 3381, in compute_loss
raise ValueError(
ValueError: The model did not return a loss from the inputs, only the following keys: logits. For reference, the inputs it received are input_ids,attention_mask.
I am trying to finetune LLama3.2 model and I did it successfully if I add the lines below: trainer = train_on_responses_only( trainer, instruction_part = "<|start_header_id|>user<|end_header_id|>\n\n", response_part = "<|start_header_id|>assistant<|end_header_id|>\n\n", )
But if I remove those lines I get the error: File "/workspace/ft.py", line 80, in
trainer_stats = trainer.train()
File "", line 142, in train
File "", line 363, in _fast_inner_training_loop
File "/usr/local/lib/python3.10/dist-packages/transformers/trainer.py", line 3318, in training_step
loss = self.compute_loss(model, inputs)
File "/usr/local/lib/python3.10/dist-packages/transformers/trainer.py", line 3381, in compute_loss
raise ValueError(
ValueError: The model did not return a loss from the inputs, only the following keys: logits. For reference, the inputs it received are input_ids,attention_mask.
Any clue what is wrong?