huggingface / swift-coreml-transformers

Swift Core ML 3 implementations of GPT-2, DistilGPT-2, BERT, and DistilBERT for Question answering. Other Transformers coming soon!
Apache License 2.0
1.61k stars 173 forks source link

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

Open harold1505 opened 5 years ago

harold1505 commented 5 years ago

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.

julien-c commented 5 years ago

Hi, you would have to either

harold1505 commented 5 years ago

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.