How to use flan-t5-small or all-MiniLM-L6-v2 in .net iOS?

mc 7,276 Reputation points
2026-08-22T06:10:58.17+00:00

I am using .net iOS (iOS application) not .net MAUI and I want to ask that how to use all-MiniLM-L6-v2 or flan-t5-small in it?

I want to feed a txt to it and ask questions about the txt ?

Developer technologies | .NET | .NET Multi-platform App UI
0 comments No comments

Answer accepted by question author
Bruce (SqlWork.com) 84,951 Reputation points
2026-08-22T15:17:39.3+00:00

first you need to convert the model for use in CoreML

https://github.com/Abhishek6353/AllMiniLML6V2-coreml

Then add the AllMiniLML6V2.mlmodel to your Maui project. Then:

#if IOS
using CoreML;
using Foundation;

public class CoreMlService
{
    public void RunModel(NSUrl modelUrl)
    {
        var error = out NSError err;
        var model = MLModel.Create(modelUrl, out err);
        // Create input features and make predictions
    }
}
#endif

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.