Просмотр исходного кода

gguf-py : fix SafetensorRemote return on undefined size (< 0) (#13841)

Beinsezii 7 месяцев назад
Родитель
Сommit
53ae30640e
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      gguf-py/gguf/utility.py

+ 1 - 1
gguf-py/gguf/utility.py

@@ -231,7 +231,7 @@ class SafetensorRemote:
         response.raise_for_status()
 
         # Get raw byte data
-        return response.content[:size]
+        return response.content[slice(size if size > -1 else None)]
 
     @classmethod
     def check_file_exist(cls, url: str) -> bool: