Skip to content

Commit

Permalink
Add a helpful error message / documentation for a missing build_vocab
Browse files Browse the repository at this point in the history
  • Loading branch information
AngledLuffa committed Nov 28, 2024
1 parent f14ff17 commit ddaba93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stanza/models/common/vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, data=None, lang="", idx=0, cutoff=0, lower=False):
self.state_attrs = ['lang', 'idx', 'cutoff', 'lower', '_unit2id', '_id2unit']

def build_vocab(self):
raise NotImplementedError()
raise NotImplementedError("This BaseVocab does not have build_vocab implemented. This method should create _id2unit and _unit2id")

def state_dict(self):
""" Returns a dictionary containing all states that are necessary to recover
Expand Down

0 comments on commit ddaba93

Please sign in to comment.