Reputation: 15
I created an mlmodel from a transformers model using the following code:
import coremltools as ct
from transformers import TFBartModel
model = TFBartModel.from_pretrained('facebook/bart-large-cnn')
input_features = [
ct.TensorType(name='input_ids', shape=(1, 1024)),
ct.TensorType(name='attention_mask', shape=(1, 1024))
]
mlmodel = ct.convert(
model,
inputs=input_features,
)
mlmodel.save("Bartt")
Doing this created an .mlpackage, which I opened up to find the .mlmodel file, which I then dragged into my Xcode project.
When I tried to view the .mlmodel file, all I got was this:
If anyone knows how I can fix this issue, so that I can properly view and use my Core ML model in my iOS app, it would be greatly appreciated!
Upvotes: 0
Views: 32