diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index 102fc6b236..24f11c9af0 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -738,7 +738,6 @@ class TextModel(ModelBase): super().prepare_metadata(vocab_only=vocab_only) total_params = self.gguf_writer.get_total_parameter_count()[0] - # Extract the encoding scheme from the file type name. e.g. 'gguf.LlamaFileType.MOSTLY_Q8_0' --> 'Q8_0' output_type: str = self.ftype.name.partition("_")[2] diff --git a/ggml/src/gguf.cpp b/ggml/src/gguf.cpp index 167dce3f2a..135555a7de 100644 --- a/ggml/src/gguf.cpp +++ b/ggml/src/gguf.cpp @@ -624,7 +624,7 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par ctx->size = 0; for (size_t i = 0; i < ctx->info.size(); ++i) { const gguf_tensor_info & ti = ctx->info[i]; - // alignment offset is only necessary for GGUF converted with reflinks + // alignment offset only exists for GGUF converted with reflinks const size_t align_offset = ti.offset % ctx->alignment; if (ti.offset - align_offset != ctx->size) { GGML_LOG_ERROR("%s: tensor '%s' has offset %" PRIu64 ", expected %zu\n", diff --git a/gguf-py/gguf/gguf_writer.py b/gguf-py/gguf/gguf_writer.py index 6429ea180d..baea41cb0e 100644 --- a/gguf-py/gguf/gguf_writer.py +++ b/gguf-py/gguf/gguf_writer.py @@ -93,7 +93,7 @@ class GGUFWriter: self.arch = arch self.endianess = endianess self.data_alignment = GGUF_DEFAULT_ALIGNMENT - self.use_reflinks = use_reflinks and hasattr(os, "copy_file_range") + self.use_reflinks = use_reflinks self.use_temp_file = False if self.use_reflinks else use_temp_file self.temp_file = None self.tensors = [{}]