Skip to content

Commit

Permalink
Fix _init_max_length in base_model.py (#185)
Browse files Browse the repository at this point in the history
* Update base_model.py

* Update base_model.py

* Removed try-except in base_model.py

* Update src/lighteval/models/base_model.py

* Revert "Update base_model.py"

This reverts commit 003d389.

---------

Co-authored-by: Clémentine Fourrier <[email protected]>
Co-authored-by: Nathan Habib <[email protected]>
  • Loading branch information
3 people authored Jul 17, 2024
1 parent 4550cb7 commit d43c9a3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/lighteval/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ def _init_max_length(self, max_length) -> int:
if hasattr(self._config, attr):
return getattr(self._config, attr)

if hasattr(self.tokenizer, "model_max_length"):
return self.tokenizer.model_max_length
# Default max sequence length setting for when no `max_length` is provided
# or no max length config setting is found in the model or tokenizer.
return 2048
Expand Down

0 comments on commit d43c9a3

Please sign in to comment.