This repository contains a script and information to convert a Huggingface models to CoreML.
$ python3 create-chat-model.py
$ git clone https://github.com/madcato/huggingface-coreml.git
$ python3 try.py
$ git submodule init && git submodule update
$ cd exporters && pip3 install -e . && cd ..
python3 export
The last step will create two mlpackage
files in the exported
folder: one for decoder and another for decoder part of the model. These files can be opened with Xcode and the model can be tested in the playground or project.
$ python3 -m exporters.coreml --model=t5-small --feature=text2text-generation exported
$ python3 -m exporters.coreml --model=distilgpt2 --feature=text2text-generation exported