# Error in Seq2SeqTrainingArguments

**URL:** <https://discuss.huggingface.co/t/error-in-seq2seqtrainingarguments/27694>\
**Category:** 🤗Transformers\
**Created:** [December 12, 2022, 12:33pm UTC](https://discuss.huggingface.co/t/error-in-seq2seqtrainingarguments/27694 "2022-12-12T12:33:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shreeshail](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shreeshail/32/12895_2.png) [@Shreeshail](https://discuss.huggingface.co/u/Shreeshail)\
**Post date:** [December 12, 2022, 12:33pm UTC](https://discuss.huggingface.co/t/error-in-seq2seqtrainingarguments/27694/1 "2022-12-12T12:33:06Z")

</div>

I am training a simple encoder-decoder transformer model on a text-to-text translation task. I am using `Seq2SeqTrainingArguments` class. It works fine when I am not using the `label_smoothing` argument. When I add `label_smoothing=0.1`, I get the following error:

```auto
ValueError Traceback (most recent call last)
Cell In[29], line 81
     74 trainer = MySeq2SeqTrainer(
     75 model=model,
     76 args=trainer_args,
     77 train_dataset=train_dataset,
     78 eval_dataset=dev_dataset
     79 )
-> 81 trainer.train()

File /data/envs/hugface/lib/python3.8/site-packages/transformers/trainer.py:1501, in Trainer.train(self, resume_from_checkpoint, trial, ignore_keys_for_eval, **kwargs)
   1496 self.model_wrapped = self.model
   1498 inner_training_loop = find_executable_batch_size(
   1499 self._inner_training_loop, self._train_batch_size, args.auto_find_batch_size
   1500 )
-> 1501 return inner_training_loop(
   1502 args=args,
   1503 resume_from_checkpoint=resume_from_checkpoint,
   1504 trial=trial,
   1505 ignore_keys_for_eval=ignore_keys_for_eval,
   1506 )

File /data/envs/hugface/lib/python3.8/site-packages/transformers/trainer.py:1749, in Trainer._inner_training_loop(self, batch_size, args, resume_from_checkpoint, trial, ignore_keys_for_eval)
...
    return forward_call(*input, **kwargs)
  File "/data/envs/hugface/lib/python3.8/site-packages/transformers/models/bert/modeling_bert.py", line 966, in forward
    raise ValueError("You have to specify either input_ids or inputs_embeds")
ValueError: You have to specify either input_ids or inputs_embeds

```

I am not able to figure out what is causing this issue.

---

<div class="post-metadata">

**Author:** ![stevhliu](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stevhliu/32/18373_2.png) [@stevhliu](https://discuss.huggingface.co/u/stevhliu)\
**Post date:** [December 12, 2022, 5:55pm UTC](https://discuss.huggingface.co/t/error-in-seq2seqtrainingarguments/27694/2 "2022-12-12T17:55:11Z")

</div>

Hi! The parameter name is [`label_smoothing_factor`](https://huggingface.co/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Seq2SeqTrainingArguments.label_smoothing_factor), can you try and see if that works? 🙂

---

<div class="post-metadata">

**Author:** ![Shreeshail](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shreeshail/32/12895_2.png) [@Shreeshail](https://discuss.huggingface.co/u/Shreeshail)\
**Post date:** [December 12, 2022, 8:15pm UTC](https://discuss.huggingface.co/t/error-in-seq2seqtrainingarguments/27694/3 "2022-12-12T20:15:05Z")

</div>

Sorry, it was a typo. I have set `label_smoothing_factor` only.

---

<div class="post-metadata">

**Author:** ![binwang](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/binwang/32/16303_2.png) [@binwang](https://discuss.huggingface.co/u/binwang)\
**Post date:** [May 30, 2023, 5:06am UTC](https://discuss.huggingface.co/t/error-in-seq2seqtrainingarguments/27694/4 "2023-05-30T05:06:53Z")

</div>

> [@Shreeshail](#):
>
> I am training a simple encoder-decoder transformer model on a text-to-text translation task. I am using `Seq2SeqTrainingArguments` class. It works fine when I am not using the `label_smoothing` argument. When I add `label_smoothing=0.1`, I get the following error:
> 
> ```auto
> 
> ```

I met the same issue, have your resolved it?
