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
Is there a way to only use the text encoder ? #113
Comments
What I have done is to set the Lines 332 to 334 in cfcffb9
I think if we can set all the visual part into None except for |
Thank you for the help, hopefully this feature will be added soon |
same needs |
You can replace |
thumb up |
finally, I succeed @jongwook @vinson2233 @ranran9991 model.py
save.py
|
@lonngxiang To highlight the code part, you can use ``` instead of `, put it on top and bottom part of code, all will be highlighted as code. |
ok,tks |
I followed this approach and got a text encoder. However, the embeddings that the model gives are completely wrong. @lonngxiang have you verified that the resulting embeddings match those of the original model? @jongwook is the above method still the recommended approach, or is there a better way by now? |
Since the above solution didn't work for me, I've used another workaround that was kind of suggested earlier in this thread. Basically, you can strip away most of the image encoder by setting Downsides are that you're still left with some useless weights from the image encoder, and that you have to use |
This is the workaround that I use as well. |
Hey!
I'd like to use only one part of the model, specifically the text encoder in my work. I don't want to store the whole model in GPU memory just to use the text encoding part, is there a simple way to do that? or will I have to dive into the code myself
Thanks for the help ! :)
The text was updated successfully, but these errors were encountered: