When TransformerBasedClassification is initialized with validations_per_epoch greater 1, then the model is incorrectly in eval mode in _train_loop_process_batches() (starting with the second iteration).
Steps to reproduce
Set validations_per_epoch to 2 and observe the training loop using the debugger.
Fixing the functionality is a one liner, the test is most of the effort. Luckily, this setting is 1 by default, so unless you set this purpose, you are likely not affected by this bug.
Bug description
When
TransformerBasedClassification
is initialized withvalidations_per_epoch
greater 1, then the model is incorrectly in eval mode in_train_loop_process_batches()
(starting with the second iteration).Steps to reproduce
Set
validations_per_epoch
to 2 and observe the training loop using the debugger.Expected behavior
--
Environment:
small-text version: 1.3.1 small-text integrations (e.g., transformers): transformers
Addition information
Fixing the functionality is a one liner, the test is most of the effort. Luckily, this setting is 1 by default, so unless you set this purpose, you are likely not affected by this bug.