]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
convert: fix convert.py not working with int filename_stem (#3028)
authorErik Scholz <redacted>
Tue, 5 Sep 2023 17:41:00 +0000 (19:41 +0200)
committerGitHub <redacted>
Tue, 5 Sep 2023 17:41:00 +0000 (19:41 +0200)
* fix implicit int to string conversion
* convert : remove an obsolete pyright comment

---------

Co-authored-by: Cebtenzzre <redacted>
convert.py

index 5a7483b43d5632d4076c8db991b8f09a9b9bffbe..59d75141de5b252345d0c713eb802bd2d84f2d5c 100755 (executable)
@@ -673,7 +673,7 @@ class LazyUnpickler(pickle.Unpickler):
         assert isinstance(pid[1], LazyStorageKind)
         data_type = pid[1].data_type
         filename_stem = pid[2]
-        filename = self.data_base_path + '/' + filename_stem
+        filename = f'{self.data_base_path}/{filename_stem}'
         info = self.zip_file.getinfo(filename)
 
         def load(offset: int, elm_count: int) -> NDArray:
@@ -689,7 +689,6 @@ class LazyUnpickler(pickle.Unpickler):
 
     @staticmethod
     def lazy_rebuild_tensor_v2(storage: Any, storage_offset: Any, size: Any, stride: Any,
-                               # pyright: ignore[reportSelfClsParameterName]
                                requires_grad: Any, backward_hooks: Any, metadata: Any = None) -> LazyTensor:
         assert isinstance(storage, LazyStorage)