(self)
| 600 | self._vocabulary = list(tokens) |
| 601 | |
| 602 | def validate(self) -> None: |
| 603 | super().validate() |
| 604 | |
| 605 | expected_vocabulary_size = self.get_vocabulary_size() |
| 606 | if len(self._vocabulary) != expected_vocabulary_size: |
| 607 | raise ValueError( |
| 608 | "Vocabulary has size %d but the model expected a vocabulary of size %d" |
| 609 | % (len(self._vocabulary), expected_vocabulary_size) |
| 610 | ) |
| 611 | |
| 612 | def save(self, output_dir: str) -> None: |
| 613 | # Save the vocabulary. |
nothing calls this directly
no test coverage detected