Skip to content

Commit

Permalink
Use getattr instead of __getattribute__ to get tokenizer args (#73)
Browse files Browse the repository at this point in the history
* Use getattr instead of __getattribute__ to get tokenizer args

* Patch minimum transformers version
  • Loading branch information
tomaarsen authored Jan 8, 2025
1 parent c360ff0 commit e98d690
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ maintainers = [
dependencies = [
"torch",
"accelerate",
"transformers>=4.19.0,<5", # required for EvalPrediction.inputs
"transformers>=4.23.0,<5", # required for EvalPrediction.inputs
"datasets>=2.14.0", # required for sorting with multiple columns
"packaging>=20.0",
"evaluate",
Expand Down
2 changes: 1 addition & 1 deletion span_marker/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __getattribute__(self, key: str) -> Any:
try:
return super().__getattribute__(key)
except AttributeError:
return super().__getattribute__("tokenizer").__getattribute__(key)
return getattr(super().__getattribute__("tokenizer"), key)

def __call__(
self, batch: Dict[str, List[Any]], return_num_words: bool = False, return_batch_encoding=False, **kwargs
Expand Down

0 comments on commit e98d690

Please sign in to comment.