Skip to content

Commit

Permalink
Expose size attribute of PassThroughVocabulary
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 638655043
  • Loading branch information
tomvdw authored and SeqIO committed May 30, 2024
1 parent 9f39c43 commit 4e09f56
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions seqio/vocabularies.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ def eos_id(self) -> Optional[Any]:
def unk_id(self) -> Optional[Any]:
return None

@property
def size(self) -> int:
return self._size

def __eq__(self, other):
if not isinstance(other, PassThroughVocabulary):
return False
Expand Down

0 comments on commit 4e09f56

Please sign in to comment.