Skip to content

Commit

Permalink
whitespace correction and captialise quantization to match common nam…
Browse files Browse the repository at this point in the history
…ing convention
  • Loading branch information
mofosyne committed Jan 10, 2024
1 parent 8c9b3cb commit 111d234
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def load(metadata_path: Path) -> "Metadata":
metadata.url = data.get("general.url")
metadata.description = data.get("general.description")
metadata.license = data.get("general.license")

return metadata


Expand Down Expand Up @@ -1327,7 +1327,7 @@ def model_parameter_count_rounded_notation(model_params_count: int) -> str:
# Millions Of Parameters
scaled_model_params = model_params_count * 1e-6
scale_suffix = "M"
else:
else:
# Thousands Of Parameters
scaled_model_params = model_params_count * 1e-3
scale_suffix = "K"
Expand Down Expand Up @@ -1523,9 +1523,9 @@ def load_vocab(

def default_outfile(model_paths: list[Path], file_type: GGMLFileType, params: Params, model_params_count: int, metadata: Metadata) -> Path:
quantization = {
GGMLFileType.AllF32: "f32",
GGMLFileType.MostlyF16: "f16",
GGMLFileType.MostlyQ8_0: "q8_0",
GGMLFileType.AllF32: "F32",
GGMLFileType.MostlyF16: "F16",
GGMLFileType.MostlyQ8_0: "Q8_0",
}[file_type]

parameters = model_parameter_count_rounded_notation(model_params_count)
Expand Down
2 changes: 2 additions & 0 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ enum llm_kv {
LLM_KV_GENERAL_ALIGNMENT,
LLM_KV_GENERAL_NAME,
LLM_KV_GENERAL_AUTHOR,
LLM_KV_GENERAL_VERSION,
LLM_KV_GENERAL_URL,
LLM_KV_GENERAL_DESCRIPTION,
LLM_KV_GENERAL_LICENSE,
Expand Down Expand Up @@ -280,6 +281,7 @@ static std::map<llm_kv, std::string> LLM_KV_NAMES = {
{ LLM_KV_GENERAL_ALIGNMENT, "general.alignment" },
{ LLM_KV_GENERAL_NAME, "general.name" },
{ LLM_KV_GENERAL_AUTHOR, "general.author" },
{ LLM_KV_GENERAL_VERSION, "general.version" },
{ LLM_KV_GENERAL_URL, "general.url" },
{ LLM_KV_GENERAL_DESCRIPTION, "general.description" },
{ LLM_KV_GENERAL_LICENSE, "general.license" },
Expand Down
1 change: 0 additions & 1 deletion requirements/requirements-convert.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ sentencepiece~=0.1.98
transformers>=4.35.2,<5.0.0
gguf>=0.1.0
protobuf>=4.21.0,<5.0.0
python-frontmatter>=1.0.1

0 comments on commit 111d234

Please sign in to comment.