Problem with convert HifiGan nemo model to riva format 
State: closed | Pull request: no
Labels: name: bug

name: TTS

**Describe the bug**

Problem with convert HifiGan nemo model to riva format 

```
[NeMo I 2024-01-25 10:49:12 save_restore_connector:249] Model HifiGanModel was successfully restored from /home/PycharmProjects/tts_train_pipeline/models/HifiGan_v2.nemo.
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/nlp-mt-exported-megatronnmtmodel.yaml for nemo.collections.nlp.models.MegatronNMTModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/asr-stt-exported-encdecctcmodel.yaml for nemo.collections.asr.models.EncDecCTCModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/nlp-isc-exported-bert.yaml for nemo.collections.nlp.models.IntentSlotClassificationModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/nlp-pc-exported-bert.yaml for nemo.collections.nlp.models.PunctuationCapitalizationModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/asr-stt-exported-encdectcmodelbpe.yaml for nemo.collections.asr.models.EncDecCTCModelBPE
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/tts-exported-fastpitchmodel.yaml for nemo.collections.tts.models.FastPitchModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/nlp-tc-exported-bert.yaml for nemo.collections.nlp.models.TextClassificationModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/nlp-tkc-exported-bert.yaml for nemo.collections.nlp.models.TokenClassificationModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/nlp-mt-exported-encdecmtmodel.yaml for nemo.collections.nlp.models.MTEncDecModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/asr-scr-exported-encdecclsmodel.yaml for nemo.collections.asr.models.classification_models.EncDecClassificationModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/tts-exported-radttsmodel.yaml for nemo.collections.tts.models.RadTTSModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/tts-exported-hifiganmodel.yaml for nemo.collections.tts.models.HifiGanModel
[NeMo I 2024-01-25 10:49:13 schema:161] Loaded schema file /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/nlp-qa-exported-bert.yaml for nemo.collections.nlp.models.QAModel
[NeMo I 2024-01-25 10:49:13 schema:200] Found validation schema for nemo.collections.tts.models.HifiGanModel at /usr/local/lib/python3.10/dist-packages/nemo2riva/validation_schemas/tts-exported-hifiganmodel.yaml
[NeMo I 2024-01-25 10:49:13 schema:229] Checking installed NeMo version ... 1.20.0 OK (>=1.1)
[NeMo I 2024-01-25 10:49:13 artifacts:59] Found model at ./model_weights.ckpt
[NeMo I 2024-01-25 10:49:13 artifacts:136] Retrieved artifacts: dict_keys(['model_config.yaml'])
[NeMo I 2024-01-25 10:49:13 cookbook:78] Exporting model HifiGanModel with config=ExportConfig(export_subnet=None, export_format='ONNX', export_file='model_graph.onnx', encryption=True, autocast=False, max_dim=None, export_args={})
Removing weight norm...
Removing weight norm...
=========== Diagnostic Run torch.onnx.export version 2.1.0a0+4136153 ===========
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================

[NeMo I 2024-01-25 10:49:15 exportable:130] Successfully exported HifiGanModel to /tmp/tmpydn8_nmj/model_graph.onnx
Traceback (most recent call last):
  File "/usr/local/bin/nemo2riva", line 8, in <module>
    sys.exit(nemo2riva())
  File "/usr/local/lib/python3.10/dist-packages/nemo2riva/cli/nemo2riva.py", line 49, in nemo2riva
    Nemo2Riva(args)
  File "/usr/local/lib/python3.10/dist-packages/nemo2riva/convert.py", line 81, in Nemo2Riva
    export_model(
  File "/usr/local/lib/python3.10/dist-packages/nemo2riva/cookbook.py", line 141, in export_model
    create_artifact(
  File "/usr/local/lib/python3.10/dist-packages/nemo2riva/artifacts.py", line 92, in create_artifact
    af.encrypt()
  File "<frozen eff.core.file>", line 128, in encrypt
PermissionError: Cannot encrypt the artifact without encryption
```

**Steps/Code to reproduce bug**

Shell command

`nemo2riva --key tlt_encode --out models/HifiGan.riva models/HifiGan_v2.nemo
`


**Environment details**

If NVIDIA docker image is used you don't need to specify these.
Otherwise, please provide:
- OS version: ubuntu 20.04
- PyTorch version 2.1.0a0+4136153
- Python version 3.10.6
- NeMo version 1.20.0


I do not know what am I missing, but I have the same issue.

Executing this command: `nemo2riva --key None --out hifigan.riva hifigan.nemo`
Results in an error: 
`[NeMo I 2024-02-15 21:43:09 exportable:130] Successfully exported HifiGanModel to /tmp/tmppe74nxmm/model_graph.onnx
Traceback (most recent call last):
  File "/home/silent/.local/bin/nemo2riva", line 8, in <module>
    sys.exit(nemo2riva())
  File "/home/silent/.local/lib/python3.10/site-packages/nemo2riva/cli/nemo2riva.py", line 49, in nemo2riva
    Nemo2Riva(args)
  File "/home/silent/.local/lib/python3.10/site-packages/nemo2riva/convert.py", line 87, in Nemo2Riva
    export_model(
  File "/home/silent/.local/lib/python3.10/site-packages/nemo2riva/cookbook.py", line 141, in export_model
    create_artifact(
  File "/home/silent/.local/lib/python3.10/site-packages/nemo2riva/artifacts.py", line 92, in create_artifact
    af.encrypt()
  File "<frozen eff.core.file>", line 128, in encrypt
PermissionError: Cannot encrypt the artifact without encryption`

Can you open an issue on https://github.com/nvidia-riva/nemo2riva? In the new issue, please provide the hifigan checkpoint that you're using.