A scalable generative AI framework built for researchers and developers working on Large Language Models, Multimodal, and Speech AI (Automatic Speech Recognition and Text-to-Speech)
The Canary model is not exportable to onnx. It seems like it was not configured to be exportable.
Steps/Code to reproduce bug
import nemo.collections.asr as nemo_asr
def main():
# Load Canary model
model_name = "nvidia/canary-1b"
print(f"Loading model: {model_name}")
model = nemo_asr.models.ASRModel.from_pretrained(model_name=model_name)
# Prepare for export
model.eval()
# Try to export - this will raise the error
output_path = "canary.onnx"
print("Attempting ONNX export...")
model.export(
output_path,
onnx_opset_version=17,
verbose=True
)
if __name__ == "__main__":
main()
This gives the error:
AttributeError: 'EncDecMultiTaskModel' object has no attribute 'output_names'
Traceback:
File "venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.__dict__)
File "app.py", line 22, in <module>
main()
File "app.py", line 15, in main
model.export(
File "nemo/core/classes/exportable.py", line 117, in export
out, descr, out_example = model._export(
^^^^^^^^^^^^^^
File "nemo/core/classes/exportable.py", line 196, in _export
output_names = self.output_names
^^^^^^^^^^^^^^^^^
File "venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1931, in __getattr__
raise AttributeError(
Expected behavior
I would expect to be able to export this model.
Environment overview (please complete the following information)
Describe the bug
The Canary model is not exportable to onnx. It seems like it was not configured to be exportable.
Steps/Code to reproduce bug
This gives the error:
Expected behavior
I would expect to be able to export this model.
Environment overview (please complete the following information)