updated hubert model safetensors conversion

This commit is contained in:
SayanoAI
2024-06-24 22:50:31 -04:00
parent 6fb35a3a42
commit b17200147c
2 changed files with 100 additions and 12 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ def get_hash(model_path):
def load_hubert(model_path: str, config):
try:
if model_path.endswith(".safetensors"):
return HubertModelWithFinalProj.load_safetensors(model_path, device=config.device)
return HubertModelWithFinalProj.from_safetensors(model_path, device=config.device)
else:
from fairseq import checkpoint_utils
models, _, _ = checkpoint_utils.load_model_ensemble_and_task([model_path],suffix="",)