]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
convert : use 'model' value if it exists. This allows karpathy/tinyllamas to load...
authorDon Mahurin <redacted>
Fri, 17 Nov 2023 15:32:34 +0000 (07:32 -0800)
committerGitHub <redacted>
Fri, 17 Nov 2023 15:32:34 +0000 (17:32 +0200)
Co-authored-by: Don Mahurin <@>
convert.py

index 3d6216f1d4e7abb376280d44fe04929ad8a1f26f..5b6344aa8fc8565503b8c8b1bbf8d976cca18ee4 100755 (executable)
@@ -690,6 +690,7 @@ def lazy_load_torch_file(outer_fp: IO[bytes], path: Path) -> ModelPlus:
                               data_base_path=pickle_paths[0][:-4],
                               zip_file=zf)
     model = unpickler.load()
+    if 'model' in model: model = model['model']
     as_dict = dict(model.items())
     return ModelPlus(model=as_dict, paths=[path], format='torch', vocab=None)