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

TypeError when training T5 with evaluate_during_training=True #1524

Open
timmartin opened this issue May 11, 2023 · 1 comment · May be fixed by #1551
Open

TypeError when training T5 with evaluate_during_training=True #1524

timmartin opened this issue May 11, 2023 · 1 comment · May be fixed by #1551

Comments

@timmartin
Copy link

Describe the bug
When training T5 with evaluate_during_training = True, it throws an exception during training:

Traceback (most recent call last):
  File "/home/timm/dev/simpletransformers/t5_minimal_start.py", line 43, in <module>
    model.train_model(train_df, eval_data=eval_df)
  File "/home/timm/dev/simpletransformers/simpletransformers/t5/t5_model.py", line 229, in train_model
    global_step, training_details = self.train(
  File "/home/timm/dev/simpletransformers/simpletransformers/t5/t5_model.py", line 758, in train
    results = self.eval_model(
  File "/home/timm/dev/simpletransformers/simpletransformers/t5/t5_model.py", line 929, in eval_model
    eval_dataset["prefix"], eval_dataset["input_text"]
  File "/home/timm/dev/simpletransformers/simpletransformers/t5/t5_utils.py", line 199, in __getitem__
    return self.examples[index]
TypeError: list indices must be integers or slices, not str

To Reproduce
Run the "T5 Minimal Start" example from the documentation.

Expected behavior
No exception.

Desktop (please complete the following information):

  • Linux

Additional context
The exception isn't thrown if you set evaluate_during_training = False.

I believe it's related to this change

@djstrong
Copy link
Contributor

djstrong commented Jun 12, 2023

I confirm the issue. You can replicate using example: https://simpletransformers.ai/docs/t5-specifics/#evaluating-generated-sequences
The example works in 0.63.9.

@lukaszett lukaszett linked a pull request Oct 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants