-
Notifications
You must be signed in to change notification settings - Fork 942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent compilation every launch in python #203
Comments
Hello @rbourgeat, we have a radar to improve this behavior for Core ML models running with coremltools in Python but it is currently pending prioritization so it wouldn't be immediately available. I recommend:
|
On a separate note, the concept "compile" is overloaded in this context. |
Hello @atiorh ! Thank you for your answer. I tried to initialize the python script directly in my code and the compilation takes 7min at each launch and after generating an image is almost instantaneous (like 2-3s). But I don't want to wait 7min each time... And for the Swift package, my app is in Python because I'm trying to do cross-platform so it's not an option for me... So in the meantime I found a solution, it is to use the Pytorch MPS device with Diffuser from HuggingFace: https://huggingface.co/docs/diffusers/optimization/mps It does not use quantized Models unfortunately but it is the best solution in Python on M1 in the meantime. And thank you for all you do, can't wait to see the next updates! |
I'm looking to optimize the use of ml-stable-diffusion python.
When i use
python_coreml_stable_diffusion.pipeline
, the model is compiled and dont use precompiled.mlmodelc
files...Why only swift package can use that ???
Is there a solution?
The text was updated successfully, but these errors were encountered: