"vscode:/vscode.git/clone" did not exist on "34abee090750d22fef357bfb1ffd564c961b9e1d"
Commit 3b194f68 authored by hwangjeff's avatar hwangjeff Committed by Facebook GitHub Bot
Browse files

Fix LibriSpeech Conforner RNN-T eval script (#2666)

Summary:
`ConformerRNNTModule`'s initializer now accepts a SentencePiece model rather than a path to a model as input. This PR corrects `eval.py` accordingly.

Pull Request resolved: https://github.com/pytorch/audio/pull/2666

Reviewed By: carolineechen

Differential Revision: D39386968

Pulled By: hwangjeff

fbshipit-source-id: 95a94dd898263d648650f7376c29810b1456d6c1
parent 8a0d7b36
......@@ -2,6 +2,8 @@ import logging
import pathlib
from argparse import ArgumentParser
import sentencepiece as spm
import torch
import torchaudio
from lightning import ConformerRNNTModule
......@@ -16,7 +18,8 @@ def compute_word_level_distance(seq1, seq2):
def run_eval(args):
model = ConformerRNNTModule.load_from_checkpoint(args.checkpoint_path, sp_model_path=str(args.sp_model_path)).eval()
sp_model = spm.SentencePieceProcessor(model_file=str(args.sp_model_path))
model = ConformerRNNTModule.load_from_checkpoint(args.checkpoint_path, sp_model=sp_model).eval()
data_module = get_data_module(str(args.librispeech_path), str(args.global_stats_path), str(args.sp_model_path))
if args.use_cuda:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment