Skip to content

Commit

Permalink
add default_bucketize_value assert for vocab_list
Browse files Browse the repository at this point in the history
  • Loading branch information
tiankongdeguiji committed Jan 20, 2025
1 parent f2e907f commit 1529dbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tzrec/features/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,10 @@ def vocab_list(self) -> List[str]:
# `default_value` and <OOV> vocab to vocab_list
assert self.config.default_bucketize_value < len(
self.config.vocab_list
), "default_bucketize_value should be less than len(vocab_list)"
), (
"default_bucketize_value should be less than len(vocab_list) "
f"in {self.__class__.__name__}[{self.name}]"
)
self._vocab_list = list(self.config.vocab_list)
else:
self._vocab_list = [self.config.default_value, "<OOV>"] + list(
Expand Down

0 comments on commit 1529dbe

Please sign in to comment.