From 74383ba6d24ff6b2b5062ff93066b87cf0bf4c6f Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 11 Jul 2024 21:10:51 +1000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: compilade --- convert_hf_to_gguf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index c6b50574f..5629888d3 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -72,7 +72,7 @@ class Model: raise TypeError(f"{type(self).__name__!r} should not be directly instantiated") if metadata is None: - raise TypeError("authorship metadata must be provided") + metadata = gguf.Metadata() self.dir_model = dir_model self.ftype = ftype @@ -101,9 +101,9 @@ class Model: logger.info(f"choosing --outtype bf16 from first tensor type ({first_tensor.dtype})") self.ftype = gguf.LlamaFileType.MOSTLY_BF16 - # Fallback to model architecture name if metadata name is still missing + # Fallback to model directory name if metadata name is still missing if self.metadata.name is None: - self.metadata.name = gguf.MODEL_ARCH_NAMES[self.model_arch] + self.metadata.name = dir_model.name # Generate parameter weight class (useful for leader boards) if not yet determined if self.metadata.parameter_class_attribute is None: