Skip to content

Commit 53ae306

Browse files
authored
gguf-py : fix SafetensorRemote return on undefined size (< 0) (#13841)
1 parent 763d06e commit 53ae306

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gguf-py/gguf/utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def get_data_by_range(cls, url: str, start: int, size: int = -1) -> bytes:
231231
response.raise_for_status()
232232

233233
# Get raw byte data
234-
return response.content[:size]
234+
return response.content[slice(size if size > -1 else None)]
235235

236236
@classmethod
237237
def check_file_exist(cls, url: str) -> bool:

0 commit comments

Comments
 (0)