From 298ed4520fb387ae815da24c8397157b6e08aec2 Mon Sep 17 00:00:00 2001 From: PF Luo Date: Fri, 28 Apr 2023 16:33:46 +0800 Subject: [PATCH] add meta-data embedding_dim to RNNLM onnx-model (#1026) --- icefall/rnn_lm/export-onnx.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/icefall/rnn_lm/export-onnx.py b/icefall/rnn_lm/export-onnx.py index 6855f9bea..b6d3a03ed 100755 --- a/icefall/rnn_lm/export-onnx.py +++ b/icefall/rnn_lm/export-onnx.py @@ -232,6 +232,7 @@ def export_with_state( L = 20 num_layers = model.rnn.num_layers hidden_size = model.rnn.hidden_size + embedding_dim = model.rnn.embedding_dim x = torch.randint(low=1, high=params.vocab_size, size=(N, L), dtype=torch.int64) y = torch.randint(low=1, high=params.vocab_size, size=(N, L), dtype=torch.int64) @@ -278,6 +279,7 @@ def export_with_state( "vocab_size": str(params.vocab_size), "num_layers": str(num_layers), "hidden_size": str(hidden_size), + "embedding_dim": str(embedding_dim), "url": "https://huggingface.co/ezerhouni/icefall-librispeech-rnn-lm", } logging.info(f"meta_data: {meta_data}")