Skip to content

Commit

Permalink
Updated tests with _target_.
Browse files Browse the repository at this point in the history
Signed-off-by: Vahid <vnoroozi@nvidia.com>
  • Loading branch information
VahidooX committed Oct 22, 2020
1 parent c24b0f6 commit 7a61905
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nemo/collections/asr/models/ctc_bpe_models.py
Expand Up @@ -70,13 +70,21 @@ def __init__(self, cfg: DictConfig, trainer=None):
cfg.decoder.vocabulary = ListConfig(list(vocabulary.values()))

# Override number of classes if placeholder provided
if cfg.decoder['num_classes'] < 1:
if "params" in cfg.decoder:
num_c = cfg.decoder["params"]["num_classes"]
else:
num_c = cfg.decoder["num_classes"]

if num_c < 1:
logging.info(
"\nReplacing placeholder number of classes ({}) with actual number of classes - {}".format(
cfg.decoder['num_classes'], len(vocabulary)
num_c, len(vocabulary)
)
)
cfg.decoder['num_classes'] = len(vocabulary)
if "params" in cfg.decoder:
cfg.decoder["params"]["num_classes"] = len(vocabulary)
else:
cfg.decoder['num_classes'] = len(vocabulary)

super().__init__(cfg=cfg, trainer=trainer)

Expand Down

0 comments on commit 7a61905

Please sign in to comment.