# Export summarization pipeline to ONNX

**URL:** <https://discuss.huggingface.co/t/export-summarization-pipeline-to-onnx/17767>\
**Category:** Beginners\
**Created:** [May 10, 2022, 11:47am UTC](https://discuss.huggingface.co/t/export-summarization-pipeline-to-onnx/17767 "2022-05-10T11:47:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asheru](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@asheru](https://discuss.huggingface.co/u/asheru)\
**Post date:** [May 10, 2022, 11:47am UTC](https://discuss.huggingface.co/t/export-summarization-pipeline-to-onnx/17767/1 "2022-05-10T11:47:10Z")

</div>

Hello,  
Can you please help me exporting **summarization** -pipeline to ONNX?  
I looked at the notebook exemplifying how to export NER pipeline to ONNX (please refer to [NLP Transformers pipelines with ONNX | by Thomas Chaigneau | Towards Data Science](https://towardsdatascience.com/nlp-transformers-pipelines-with-onnx-9b890d015723)).

In the NER example, a class was inherited from TokenClassificationPipeline, and the method \_forward was overrided, such that “self.model(model\_inputs.data)” was replaced by “session.run(output\_names=[outputs\_name], input\_feed=inputs)” . (inputs is a conversion of inputs\_data to numpy arrays.)

Trying to mimic the procedure to Summarization, my problem:  
I inherited a class from SummarizationPipeline, and then tried to override the \_generate method. However, I do not succeed to replace “self.tokenizer.decode(…)” with “session.run(…)”. Any idea please?  
Thank you,  
([mailto:asher.uziel@gmail.com](mailto:asher.uziel@gmail.com))
