Skip to content
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

Converting a pipeline #3

Closed
MatthewWaller opened this issue Sep 9, 2022 · 4 comments
Closed

Converting a pipeline #3

MatthewWaller opened this issue Sep 9, 2022 · 4 comments

Comments

@MatthewWaller
Copy link

What would it take to convert an entire pipeline to a coreml model?

For instance, I have saved the stable-diffusion checkpoint, and several of the models have their own configs, but of course they're not the ready-made configs.

Screen Shot 2022-09-08 at 10 24 00 PM

Would this be just a long, hard, custom slog via exporters and not worth it? Or is there something here worth pursuing?

@MatthewWaller
Copy link
Author

For folks interested, I added a comment to this gist that has a bunch of the models converted. 3 out of 4!

One bit I'm trying to convert is CLIP. Since the model uses the CLIPTextModel, and the CLIPTextEncoder.

Thoughts about how I might go about this? I get a
Torch var mask.3 not found in context and a whole bunch of warnings that a tensor is getting converted to a boolean.

And then I'm also not sure how I could convert the scheduler. Or if I can ignore that.

https://gist.github.com/madebyollin/86b9596ffa4ab0fa7674a16ca2aeab3d

@MatthewWaller
Copy link
Author

Ha! The original author of the post was gracious enough to fix up that CLIPTextEncoder. Nice.

One thing I'll need to tackle implementing to start experiment running on iPhone and iPad and Mac app is the tokenizer.

I've opened an issue here if folks know the answer: huggingface/swift-coreml-transformers#28

@rovo79
Copy link

rovo79 commented Oct 20, 2023

@MatthewWaller Did you ever get anywhere with this pipeline conversion?

@MatthewWaller
Copy link
Author

@MatthewWaller Did you ever get anywhere with this pipeline conversion?

@rovo79 i eventually converted a stable diffusion pipeline, but it was just a long hard slog, and there is now an entire Apple repo on converting stable diffusion and other libraries. So much happened in a year! So I don’t think this issue needs addressing anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants