You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found that the cause of this exception is that in Jupyter Notebook, for a transformers.Trainer, when its argument eval_on_start is set to True, running Trainer.train() will lead to the following function execution order:
NotebookProgressCallback.on_train_begin()
NotebookProgressCallback.on_prediction_step()
NotebookProgressCallback.on_train_end()
Running NotebookProgressCallback.on_prediction_step() directly after NotebookProgressCallback.on_train_begin() will result in two attributes of NotebookProgressBar, i.e., value and label, being used before assigned (see methods update(), update_bar() and display() of NotebookProgressBar in transformers/utils/notebook.py for details).
…ainer` with `eval_on_start=True` in Jupyter Notebook. (huggingface#32849)
fix: `AttributeError` raised when using `Trainer` with `eval_on_start=True` in Jupyter Notebook.
System Info
transformers
: '4.44.0'Python
: '3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0]'Who can help?
@muellerz @SunMarc
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Here is a self-contained script that triggers the error:
The error I get is
which seems related to the fact that I'm running the code in a Jupyter notebook.
Expected behavior
I should be able to use the
eval_on_start
parameter without triggering an error.The text was updated successfully, but these errors were encountered: