swift-coreml-transformers icon indicating copy to clipboard operation
swift-coreml-transformers copied to clipboard

is there any way to convert other pytorch transformers to mlmodel?

Open harold1505 opened this issue 6 years ago • 2 comments

Here the model generation shows how to convert gpt2 model specifically to mlmodel. How to apply this to other models like pretrained bert and xlnet? please help.

harold1505 avatar Aug 01 '19 06:08 harold1505

Hi, you would have to either

  • write a similar converter for another model (all those models are similar so the code wouldn't be so different),
  • or export to onnx then use onnx-coreml. (onnx-coreml does not fully support CoreML 3 right now but it's being worked on actively)

julien-c avatar Aug 01 '19 14:08 julien-c

Thanks a lot for your reply. I have tried onnx-coreml but it doesn't provide support for all layers. I will try to write a converter like the one provided in the example.

harold1505 avatar Aug 02 '19 05:08 harold1505