From 2c51593549dfa9d32e4045d4adb7b812c68c238a Mon Sep 17 00:00:00 2001 From: Beinsezii Date: Tue, 27 May 2025 22:47:24 -0700 Subject: [PATCH 1/2] gguf/utility: return full content on size < 0 --- gguf-py/gguf/utility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gguf-py/gguf/utility.py b/gguf-py/gguf/utility.py index e5251aef8c832..5b6b7ea45d79c 100644 --- a/gguf-py/gguf/utility.py +++ b/gguf-py/gguf/utility.py @@ -231,7 +231,7 @@ def get_data_by_range(cls, url: str, start: int, size: int = -1) -> bytes: response.raise_for_status() # Get raw byte data - return response.content[:size] + return response.content[:size] if size > -1 else response.content @classmethod def check_file_exist(cls, url: str) -> bool: From 05e23d1a99a1df251f26c1567befd63adaad3e4c Mon Sep 17 00:00:00 2001 From: Beinsezii <39478211+Beinsezii@users.noreply.github.com> Date: Wed, 28 May 2025 13:53:44 -0700 Subject: [PATCH 2/2] Update gguf-py/gguf/utility.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sigbjørn Skjæret --- gguf-py/gguf/utility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gguf-py/gguf/utility.py b/gguf-py/gguf/utility.py index 5b6b7ea45d79c..00adcbc937398 100644 --- a/gguf-py/gguf/utility.py +++ b/gguf-py/gguf/utility.py @@ -231,7 +231,7 @@ def get_data_by_range(cls, url: str, start: int, size: int = -1) -> bytes: response.raise_for_status() # Get raw byte data - return response.content[:size] if size > -1 else response.content + return response.content[slice(size if size > -1 else None)] @classmethod def check_file_exist(cls, url: str) -> bool: