PEGASUS using ONNX
Hello  @patrickvonplaten. , I just uploaded my fine-tuned model to the hub and I wanted to use ONNX to convert the pytorch model and be able to use it in a JavaScript back-end.
**I used the following command:**
`!python3 -m transformers.convert_graph_to_onnx --model Karimfayed/pegasus-SAMSum --framework pt pegasus-SAMSum.onnx`
**I receive the following error message:**

> Error while converting the model: Unrecognized configuration class <class 'transformers.configuration_pegasus.PegasusConfig'> for this kind of AutoModel: AutoModel.
Model type should be one of RetriBertConfig, T5Config, DistilBertConfig, AlbertConfig, CamembertConfig, XLMRobertaConfig, BartConfig, LongformerConfig, RobertaConfig, LayoutLMConfig, SqueezeBertConfig, BertConfig, OpenAIGPTConfig, GPT2Config, MobileBertConfig, TransfoXLConfig, XLNetConfig, FlaubertConfig, FSMTConfig, XLMConfig, CTRLConfig, ElectraConfig, ReformerConfig, FunnelConfig, LxmertConfig, BertGenerationConfig, DebertaConfig, DPRConfig, XLMProphetNetConfig, ProphetNetConfig.

**Is PEGASUS going to be added to the list soon or is there any way around it?**

Hello @karimfayed! We're in the process of switching our approach relative to using the ONNX converter. See the following PR https://github.com/huggingface/transformers/pull/11786.

It has support for BART, so enabling support for Pegasus should be fairly simple. Please let us know if you run into any issues.

You can see the docs here: https://235542-155220641-gh.circle-artifacts.com/0/docs/_build/html/serialization.html

Please make sure to git checkout the PR first!<|||||>> Hello @karimfayed! We're in the process of switching our approach relative to using the ONNX converter. See the following PR #11786.
> 
> It has support for BART, so enabling support for Pegasus should be fairly simple. Please let us know if you run into any issues.
> 
> You can see the docs here: https://235542-155220641-gh.circle-artifacts.com/0/docs/_build/html/serialization.html
> 
> Please make sure to git checkout the PR first!

Hello @LysandreJik , thank you for your help. I read both the [docs](https://235542-155220641-gh.circle-artifacts.com/0/docs/_build/html/serialization.html) and the issue and I used the command : 
`!python3 -m transformers.onnx -f pytorch --model=Karimfayed/pegasus-SAMSum --features=default --optimize --optimization-level=all onnx/Karimfayed/pegasus-SAMSum/`

**but I keep getting this error**

> /usr/bin/python3: No module named transformers.onnx

**Even when I replace ` transformers.onnx` with `transformers.onnx.export ` I get this error:**

> /usr/bin/python3: Error while finding module specification for 'transformers.onnx.export' (ModuleNotFoundError: No module named 'transformers.onnx')<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.