Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli/paraformer] ali-paraformer inference #2067

Merged
merged 21 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mv the intermediate files to the assets directory
  • Loading branch information
Mddct committed Oct 23, 2023
commit e8fa0132fc4957d3448c0a57fe94f2520c300652
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ encoder_conf:
kernel_size: 11
sanm_shfit: 0

input_dim: 80
output_dim: 8404
paraformer: true
# decoder related
decoder: SanmDecoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,8 @@ def main():
char_dict = {v: k for k, v in symbol_table.items()}
with open(args.config, 'r') as fin:
configs = yaml.load(fin, Loader=yaml.FullLoader)

# mean, istd = load_cmvn(args.cmvn, is_json=True)
# global_cmvn = GlobalCMVN(
# torch.from_numpy(mean).float(),
# torch.from_numpy(istd).float())
# configs['encoder_conf']['input_size'] = 80 * 7
# encoder = SanmEncoder(global_cmvn=global_cmvn, **configs['encoder_conf'])
# configs['decoder_conf']['vocab_size'] = len(char_dict)
# configs['decoder_conf']['encoder_output_size'] = encoder.output_size()
# decoder = SanmDecoer(**configs['decoder_conf'])

# # predictor = PredictorV3(**configs['predictor_conf'])
# predictor = Predictor(**configs['predictor_conf'])
# model = AliParaformer(encoder, decoder, predictor)
configs['cmvn_file'] = args.cmvn
configs['is_json_cmvn'] = True
configs['input_dim'] = 80
configs['output_dim'] = len(char_dict)
model = init_model(configs)
load_checkpoint(model, args.ali_paraformer)
model.eval()
Expand Down
1 change: 0 additions & 1 deletion wenet/utils/init_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def init_model(configs):
if isinstance(encoder, SanmEncoder):
assert isinstance(decoder, SanmDecoer)
# NOTE(Mddct): only support inference for now
print('hello world')
model = AliParaformer(encoder, decoder, predictor)
else:
model = Paraformer(vocab_size=vocab_size,
Expand Down