Skip to content

Commit

Permalink
gguf-py : do not use title case for naming convention
Browse files Browse the repository at this point in the history
Some models use acronyms in lowercase,
which can't be title-cased like other words,
so it's best to simply use the same case
as in the original model name.

Note that the size label still has an uppercased suffix
to make it distinguishable from the context size of a finetune.
  • Loading branch information
compilade committed Jul 20, 2024
1 parent bf8e71b commit 1932a1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gguf-py/gguf/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def naming_convention(model_name: str | None, base_name: str | None, finetune_st
# Reference: https://github.com/ggerganov/ggml/blob/master/docs/gguf.md#gguf-naming-convention

if base_name is not None:
name = base_name.strip().title().replace(' ', '-').replace('/', '-')
name = base_name.strip().replace(' ', '-').replace('/', '-')
elif model_name is not None:
name = model_name.strip().title().replace(' ', '-').replace('/', '-')
name = model_name.strip().replace(' ', '-').replace('/', '-')
else:
name = "ggml-model"

parameters = f"-{size_label}" if size_label is not None else ""

finetune = f"-{finetune_string.strip().title().replace(' ', '-')}" if finetune_string is not None else ""
finetune = f"-{finetune_string.strip().replace(' ', '-')}" if finetune_string is not None else ""

version = f"-{version_string.strip().replace(' ', '-')}" if version_string is not None else ""

Expand Down

0 comments on commit 1932a1b

Please sign in to comment.