Update HubertSoft.py

This commit is contained in:
YuriHead 2023-05-15 00:10:21 +08:00 committed by GitHub
parent ee9e6e7994
commit ae894f2c63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -17,6 +17,7 @@ class HubertSoft(SpeechEncoder):
if feats.dim() == 2: # double channels
feats = feats.mean(-1)
assert feats.dim() == 1, feats.dim()
feats = feats[None,None,:]
with torch.inference_mode():
units = self.model.units(feats)
return units.transpose(1,2)