duplex_text_normalization_infer.py FST error
State: closed | Pull request: no
Labels: name: bug

name: TN/ITN

**Describe the bug**

Runtime crashes when running the inference example with T5 pretrained model.

**Steps/Code to reproduce bug**

`python examples/nlp/duplex_text_normalization/duplex_text_normalization_infer.py lang=en mode=tn tagger_pretrained_model=neural_text_normalization_t5 decoder_pretrained_model=neural_text_normalization_t5 inference.from_file=./text_en.txt`

Traceback:
```python
[NeMo I 2022-07-06 11:06:49 duplex_text_normalization_infer:83] Running inference on ./text_en.txt...
  0%|                                                                                                                             | 0/1 [00:00<?, ?it/s]ERROR: StringFstToOutputLabels: Invalid start state
Error executing job with overrides: ['lang=en', 'mode=tn', 'tagger_pretrained_model=neural_text_normalization_t5', 'decoder_pretrained_model=neural_text_normalization_t5', 'inference.from_file=./text_en.txt']
An error occurred during Hydra's exception formatting:
AssertionError()
Traceback (most recent call last):
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/_internal/utils.py", line 252, in run_and_report
    assert mdl is not None
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "examples/nlp/duplex_text_normalization/duplex_text_normalization_infer.py", line 155, in <module>
    main()
  File "/private/home/kulikov/code/NeMo/nemo/core/config/hydra_runner.py", line 104, in wrapper
    _run_hydra(
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/_internal/utils.py", line 377, in _run_hydra
    run_and_report(
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/_internal/utils.py", line 294, in run_and_report
    raise ex
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/_internal/utils.py", line 211, in run_and_report
    return func()
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/_internal/utils.py", line 378, in <lambda>
    lambda: hydra.run(
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 111, in run
    _ = ret.return_value
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/core/utils.py", line 233, in return_value
    raise self._return_value
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/hydra/core/utils.py", line 160, in run_job
    ret.return_value = task_function(task_cfg)
  File "examples/nlp/duplex_text_normalization/duplex_text_normalization_infer.py", line 91, in main
    new_lines = normalizer_electronic.normalize_list(lines)
  File "/private/home/kulikov/code/NeMo/nemo_text_processing/text_normalization/normalize.py", line 150, in normalize_list
    raise e
  File "/private/home/kulikov/code/NeMo/nemo_text_processing/text_normalization/normalize.py", line 145, in normalize_list
    normalized_texts = Parallel(n_jobs=n_jobs)(
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/joblib/parallel.py", line 1043, in __call__
    if self.dispatch_one_batch(iterator):
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/joblib/parallel.py", line 861, in dispatch_one_batch
    self._dispatch(tasks)
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/joblib/parallel.py", line 779, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/joblib/_parallel_backends.py", line 208, in apply_async
    result = ImmediateResult(func)
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/joblib/_parallel_backends.py", line 572, in __init__
    self.results = batch()
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/joblib/parallel.py", line 262, in __call__
    return [func(*args, **kwargs)
  File "/private/home/kulikov/miniconda3/envs/nemo/lib/python3.8/site-packages/joblib/parallel.py", line 262, in <listcomp>
    return [func(*args, **kwargs)
  File "/private/home/kulikov/code/NeMo/nemo_text_processing/text_normalization/normalize.py", line 164, in __process_batch
    normalized_lines = [
  File "/private/home/kulikov/code/NeMo/nemo_text_processing/text_normalization/normalize.py", line 165, in <listcomp>
    self.normalize(
  File "/private/home/kulikov/code/NeMo/nemo_text_processing/text_normalization/normalize.py", line 268, in normalize
    tagged_text = self.select_tag(tagged_lattice)
  File "/private/home/kulikov/code/NeMo/nemo_text_processing/text_normalization/normalize.py", line 382, in select_tag
    tagged_text = pynini.shortestpath(lattice, nshortest=1, unique=True).string()
  File "extensions/_pynini.pyx", line 471, in _pynini.Fst.string
  File "extensions/_pynini.pyx", line 516, in _pynini.Fst.string
_pywrapfst.FstOpError: Operation failed
```

where

```
cat text_en.txt

he was born in 1992
```


**Expected behavior**

The example is expected to work! Looks like smth is wrong with the pynini lib.

**Environment overview (please complete the following information)**

 - Environment location: bare metal
 - Method of NeMo install: I used conda install
 - If method of install is [Docker], provide `docker pull` & `docker run` commands used

**Environment details**

If NVIDIA docker image is used you don't need to specify these.
Otherwise, please provide:
- OS version Ubuntu
- PyTorch version 1.12.0
- Python version 3.8.0

**Additional context**

pynini 2.1.4