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

Why there is no LlavaForSequenceClassification ? #31814

Open
Zuhashaik opened this issue Jul 6, 2024 · 4 comments
Open

Why there is no LlavaForSequenceClassification ? #31814

Zuhashaik opened this issue Jul 6, 2024 · 4 comments
Labels
Feature request Request for a new feature

Comments

@Zuhashaik
Copy link

Zuhashaik commented Jul 6, 2024

Feature request

Need of LlavaForSequenceClassification class in 'src/transformers/models/llava/modeling_llava.py'..

Motivation

If there is a LlavaForSequenceClassification class we can use decoder only models for classification tasks.

Your contribution

Allow me to contribute to this as I am already working on this model for mental health meme classification for the upcoming AAAI conference.

@Zuhashaik Zuhashaik added the Feature request Request for a new feature label Jul 6, 2024
@amyeroberts
Copy link
Collaborator

Hi @Zuhashaik, thanks for opening this issue!

We only add specific task heads for models if there are official checkpoints available; the task is described in the original paper or there's a large community demand.

@NielsRogge
Copy link
Contributor

Note that you could technically also use LlavaForConditionalGeneration by training the model to only spit out one classification token per image.

@Zuhashaik
Copy link
Author

Note that you could technically also use LlavaForConditionalGeneration by training the model to only spit out one classification token per image.

Yeah I've attached an score layer at the top of the model by passing those last layer hidden states. While doing this, some cuda related issues ("data in different devices cuda:0 and cuda:1") came up.

So I've changed my LlavaForConditionalGeneration class itself in modelling_llava.py file (added score layer) and used that for classification.

Thankyou.

@Zuhashaik
Copy link
Author

I am facing lots of data type and quantization errors while defining classifier (score) separately please initiate LlavaForSequenceClassification and SequenceClassification for vision models..

Hi @Zuhashaik, thanks for opening this issue!

We only add specific task heads for models if there are official checkpoints available; the task is described in the original paper or there's a large community demand.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants