From 111d2347394c2b2f6d9906d7bb6f29adf5d048de Mon Sep 17 00:00:00 2001 From: brian khuu Date: Thu, 11 Jan 2024 02:06:23 +1100 Subject: [PATCH] whitespace correction and captialise quantization to match common naming convention --- convert.py | 10 +++++----- llama.cpp | 2 ++ requirements/requirements-convert.txt | 1 - 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/convert.py b/convert.py index 67e281aa57200e..8d3576689e0e25 100755 --- a/convert.py +++ b/convert.py @@ -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 @@ -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" @@ -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) diff --git a/llama.cpp b/llama.cpp index e1f1932baecf15..864b2b000f363d 100644 --- a/llama.cpp +++ b/llama.cpp @@ -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, @@ -280,6 +281,7 @@ static std::map 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" }, diff --git a/requirements/requirements-convert.txt b/requirements/requirements-convert.txt index 727bcd23a19ac7..a3d6ecec0ac043 100644 --- a/requirements/requirements-convert.txt +++ b/requirements/requirements-convert.txt @@ -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 \ No newline at end of file