Conversation
TODO: Clarify the difference between encode and quantize
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I've made a few changes, it's important to respect and not modify the base Codec class. It's not yet passing the tests but almost |
LTMeyer
left a comment
There was a problem hiding this comment.
It's getting shapes! Thank you. I made a couple of comments.
| return self.encode(x, channel_mask) | ||
|
|
||
|
|
||
| class QuantizedCodec(Codec): |
There was a problem hiding this comment.
Why removing this class?
It made the distinction simpler between codec that rely on quantization and tokenizer that don't. It avoids the if statements in several methods. Do we actually have any tokenizer that is not using a quantizer?
There was a problem hiding this comment.
I wanted to do minimal changes. I didn't want to change the codec APIs, but I guess that ship has sailed ^^'
There was a problem hiding this comment.
can you just give me this one?
There was a problem hiding this comment.
ok, I'll change ^^. But just to explain why I didn't want to change the API here:
My objective was not to make a clean code base here, for two reasons:
- The more we refactor, the more work it is to refactor all tokenizers + the higher the chance of introducing difference in behavior
- This code is going to stay 100% frozen, we are not going to reuse any of it moving forward. So, this is not the right place to do a lot of refactoring, that would be on the MMOMA side.
Making small edits on what relates to the directly relevant user-facing API (i.e. encode/decode) that makes sense from the perspective of simplifying the user experience, but the rest I would have preferred not to change anything.
There was a problem hiding this comment.
Hummm actually, looking at the code, I'd rather not change it.
All the codecs we have for AION-1 are QuantizedCodec, no point in adding subclasses. I'll remove the 'is_quantized' statements if you want, but no need for more complexity
Co-authored-by: Lucas Meyer <LTMeyer@users.noreply.github.com>
Co-authored-by: Lucas Meyer <LTMeyer@users.noreply.github.com>
Update AION code to have image preprocessing native in the codec