Open gsigms opened 1 year ago
You can get the MIL code for a Core ML model (wether converted to mlprogram
or neuralnetwork
) by calling ._get_mil_internal()
on your MLModel.
Looks like there is no way to initialize a MIL Builder using MIL code. That functionality shouldn't be too hard to add.
I'll keep this issue open as a feature request.
@gsigms - can you tell us a little more about your use case?
In the use case I am working on, I have alternative torch models and post processing code, that are traced/converted. I would like to write, say a beam search using a MIL Builder approach and compose its loop body using converted models.
The alternative approach I was contemplating is to write that beam search and export it via torch.jit.script with a traced model inside.
❓Question
Is it possible to interface models converted to mlprogram with the mil builder? This would help with creating program with control flow without the hurdle of mixing scripted/traced torchscript models