fix librispeech ASR pruned_transducer_stateless5 export (#704)

This commit is contained in:
Senyan Li 2022-11-25 14:39:56 +08:00 committed by GitHub
parent e5d942696a
commit 4c636c2cff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,7 @@ from pathlib import Path
import sentencepiece as spm
import torch
from scaling_converter import convert_scaled_to_non_scaled
from train import add_model_arguments, get_params, get_transducer_model
from icefall.checkpoint import (
@ -263,6 +264,7 @@ def main():
# it here.
# Otherwise, one of its arguments is a ragged tensor and is not
# torch scriptabe.
convert_scaled_to_non_scaled(model, inplace=True)
model.__class__.forward = torch.jit.ignore(model.__class__.forward)
logging.info("Using torch.jit.script")
model = torch.jit.script(model)

View File

@ -0,0 +1 @@
../lstm_transducer_stateless2/lstmp.py

View File

@ -0,0 +1 @@
../pruned_transducer_stateless3/scaling_converter.py