Update HubertSoft.py

This commit is contained in:
YuriHead 2023-05-14 22:53:07 +08:00 committed by GitHub
parent eae42c0dcd
commit 0de441a5ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ from vencoder.hubert import hubert_model
class HubertSoft(SpeechEncoder):
def __init__(self,vec_path = "pretrain/hubert-soft-0d54a1f4.pt",device=None):
print("load model(s) from {}".format(vec_path))
hubert_soft = hubert_model.hubert_soft("hubert/hubert-soft-0d54a1f4.pt")
hubert_soft = hubert_model.hubert_soft(vec_path)
if device is None:
self.dev = torch.device("cuda" if torch.cuda.is_available() else "cpu")
else:
@ -21,4 +21,4 @@ class HubertSoft(SpeechEncoder):
feats = feats.view(1, -1)
with torch.inference_mode():
units = self.model.units(feats)
return units.transpose(1,2)
return units.transpose(1,2)