Skip to content

Commit 8ee4007

Browse files
authored
Merge pull request #203 from ebraraktas/fix/conformer-tflite-conversion
Fix/conformer tflite conversion
2 parents 9805d14 + 94b3f49 commit 8ee4007

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/conformer/tflite.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434

3535
parser.add_argument("--saved", type=str, default=None, help="Path to saved model")
3636

37-
parser.add_argument("--subwords", type=str, default=None, help="Use subwords")
37+
parser.add_argument("--subwords", action="store_true", help="Use subwords")
38+
39+
parser.add_argument("--vocabulary", type=str, default=None, required=False,
40+
help="Path to vocabulary. Overrides path in config, if given.")
3841

3942
parser.add_argument("output", type=str, default=None, help="TFLite file path to be exported")
4043

@@ -45,6 +48,9 @@
4548
config = Config(args.config)
4649
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
4750

51+
if args.vocabulary is not None:
52+
config.decoder_config["vocabulary"] = args.vocabulary
53+
4854
if args.subwords:
4955
text_featurizer = SubwordFeaturizer(config.decoder_config)
5056
else:

0 commit comments

Comments
 (0)