convert : skip unknown tensors (need for LLaVA)

This commit is contained in:
Georgi Gerganov 2024-02-13 19:58:44 +02:00
parent 07f5cd7bec
commit 6b8d69b451
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -1195,7 +1195,9 @@ def convert_model_names(model: LazyModel, params: Params) -> LazyModel:
for name, lazy_tensor in model.items(): for name, lazy_tensor in model.items():
tensor_type, name_new = tmap.get_type_and_name(name, try_suffixes = (".weight", ".bias")) or (None, None) tensor_type, name_new = tmap.get_type_and_name(name, try_suffixes = (".weight", ".bias")) or (None, None)
if name_new is None: if name_new is None:
raise Exception(f"Unexpected tensor name: {name}") #raise Exception(f"Unexpected tensor name: {name}")
print(f"Unexpected tensor name: {name} - skipping")
continue
if tensor_type in should_skip: if tensor_type in should_skip:
print(f"skipping tensor {name_new}") print(f"skipping tensor {name_new}")