-
Notifications
You must be signed in to change notification settings - Fork 9
Add Image Tokenizer #8
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
Conversation
TODO: Clarify the difference between encode and quantize
|
excellent! To your 2 questions.... I think we would need to do the same exercise only for a few additional tokenizers:
Regarding whether it's a problem to not have training code and such, the answer is no. We can release separately the training code and everything that comes with it. It's also not fundamentally a problem that MMOMA is continuing to evolve separately. When codecs for AION-2 are ready, we do a bit of code cleaning such that it will be easier to export them correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
lol, thanks Copilot, very in depth review you did there |
|
I've checked locally that we can reproduce the same encoded output for a batch from legacysurvey. I would like to upload the model on HF (privately to start with). I could then fetch directly the weights from HF in the tests otherwise I would need to upload the 200MB checkpoint. |
Test that uploaded model reproduces previous predictions.
Rename test data for image codec.
Testing fixes to online tests
Context
This PR is related to #6 (comment).
We want to be able to ship the model and tokenizers as standalone classes to simplify the readability, maintenance, and distribution of the code. Currently, the only way to load trained tokenizer is using the
load_tokenizermethod that relies ontorch.package. It loads all the dependencies stored with the trained tokenizer. It hides the core classes and their logic.This PR rewrites the image tokenizer saved at
/mnt/ceph/users/polymathic/mmoma/outputs/multisurvey/a88h9lef/checkpoints/HSC+DECaLSCodec-epoch=02.ckpt.pt.Process
Code Generation
The process to rewrite the code is:
inspect(see Beta testers program todo #6 (comment) for more details)torch.nn.moduleinstead of functions to implement models)Model Weights Retrieval
Based on the original state dict, we can change the keys to generate a new state dict that is compatible with the model.
I have checked that we get the same output from the same random input.
Questions
To decide if we want to merge this PR and proceed with the remaining tokenizers (39 according to @EiffL) we should answer the following questions in addition to reviewing the code.