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

convert : use 'model' value if it exists. This allows karpathy/tinyllamas to load (#4089)

Co-authored-by: Don Mahurin <@>
Don Mahurin 2 лет назад
Родитель
Сommit
2ab0707acb
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      convert.py

+ 1 - 0
convert.py

@@ -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)