Skip to content

Commit

Permalink
revert function renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Xarbirus committed Mar 13, 2024
1 parent 0a1322a commit 94a1050
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ def bounded_parallel_map(func: Callable[[In], Out], iterable: Iterable[In], conc
yield result


def prepare_vocab(params: Params, vocab: Vocab, pad_vocab: bool = False) -> None:
def check_vocab_size(params: Params, vocab: Vocab, pad_vocab: bool = False) -> None:
# Handle special case where the model's vocab size is not set
if params.n_vocab == -1:
raise ValueError(
Expand Down Expand Up @@ -1105,7 +1105,7 @@ def write_vocab_only(
fname_out: Path, params: Params, vocab: Vocab, svocab: gguf.SpecialVocab,
endianess: gguf.GGUFEndian = gguf.GGUFEndian.LITTLE, pad_vocab: bool = False,
) -> None:
prepare_vocab(params, vocab, pad_vocab=pad_vocab)
check_vocab_size(params, vocab, pad_vocab=pad_vocab)

of = OutputFile(fname_out, endianess=endianess)

Expand Down Expand Up @@ -1137,7 +1137,7 @@ def write_all(
concurrency: int = DEFAULT_CONCURRENCY, endianess: gguf.GGUFEndian = gguf.GGUFEndian.LITTLE,
pad_vocab: bool = False,
) -> None:
prepare_vocab(params, vocab, pad_vocab=pad_vocab)
check_vocab_size(params, vocab, pad_vocab=pad_vocab)

of = OutputFile(fname_out, endianess=endianess)

Expand Down

0 comments on commit 94a1050

Please sign in to comment.