swift-coreml-transformers
swift-coreml-transformers copied to clipboard
is there any way to convert other pytorch transformers to mlmodel?
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.
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-coremldoes not fully support CoreML 3 right now but it's being worked on actively)
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.