Skip to content

Commit e136a19

Browse files
Apply suggestion from @MahmoudAshraf97
Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com> Signed-off-by: Piotr Żelasko <petezor@gmail.com>
1 parent 5e32850 commit e136a19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/speech_recognition/convert_torchaudio_nemo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def migrate_state_dict(state_dict: dict) -> tuple[dict, list[tuple[str, str]]]:
6363
for old_suffix, new_suffix in KEY_MIGRATION.items():
6464
if key.endswith(old_suffix):
6565
new_key = key[: -len(old_suffix)] + new_suffix
66-
state_dict[new_key] = state_dict.pop(key)
66+
if "featurizer.fb" in new_suffix:
67+
state_dict[new_key] = state_dict.pop(key).T.unsqueeze(0)
68+
else:
69+
state_dict[new_key] = state_dict.pop(key)
6770
renames.append((key, new_key))
6871
break
6972
return state_dict, renames

0 commit comments

Comments
 (0)