-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Add CogVLM #27718
Add CogVLM #27718
Conversation
def __init__(self, image_processor, tokenizer, image_size, patch_size): | ||
super().__init__(image_processor, tokenizer) | ||
self.image_size = image_size | ||
self.patch_size = patch_size |
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.
cc @ydshieh for this model, I need to store 2 attributes to the processor, however we currently don't have a processor_config.json
file. Can we add support for this in from_pretrained
and save_pretrained
?
def __init__(self, image_processor, tokenizer, image_size, patch_size): | ||
super().__init__(image_processor, tokenizer) | ||
self.image_size = image_size | ||
self.patch_size = patch_size |
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.
cc @ydshieh for this model, I need to store 2 attributes to the processor, however we currently don't have a processor_config.json
file. Can we add support for this in from_pretrained
and save_pretrained
?
fc83063
to
d3c5fc3
Compare
A cleaner implementation I'm working on is here: https://github.com/NielsRogge/transformers/tree/add_cogvlm_cleaner. It implements the model like llava, by adding the image tokens inside the model, rather than creating them in the processor class. |
Closing this one in favor of the PR above. |
What does this PR do?
This PR adds CogVLM natively into the Transformers library (it's already usable with
trust_remote_code=True
, but with this PR one can run it without the xformers, einops and triton dependencies).To do:
FastRotaryEmbedding
optional)Processor
#27761