Skip to content

Commit

Permalink
docstring clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed Nov 9, 2022
1 parent 4be897b commit e85e0e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions miditok/bpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@ def add_bpe_to_tokens_type_graph(self):
self.tokens_types_graph['BPE'] = list(self.tokens_types_graph.keys())

def save_params(self, out_dir: Union[str, Path, PurePath], additional_attributes: Dict = None):
r"""Saves the base parameters of this encoding in a txt file.
Useful to keep track of how a dataset has been tokenized / encoded.
r"""Saves the config / base parameters of the tokenizer in a file.
Useful to keep track of how a dataset has been tokenized / encoded
It will also save the name of the class used, i.e. the encoding strategy.
NOTE: as json can't save tuples as keys, the beat ranges are saved as strings
with the form startingBeat_endingBeat (underscore separating these two values).
NOTE: the vocabulary (token_to_event) will be saved with the 'vocab' key, that will be decoded
back by the load_params method.
NOTE 2: as json cant save tuples as keys, the beat ranges are saved as strings
with the form startingBeat_endingBeat (underscore separating these two values)
:param out_dir: output directory to save the file
:param additional_attributes: any additional information to store in the config file. (default: None)
Expand Down

0 comments on commit e85e0e5

Please sign in to comment.