mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #285] How can i get every word feature in the text instand of the text feature? #245
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#245
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Cola-any on GitHub (Sep 1, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/285
`class CLIPTransformer(nn.Module):
def init(self, config: Config):
super(CLIPTransformer, self).init()
self.config = config
I want to get the all the word features in the text, instand of the text feature
text_features = self.clip.get_text_features(**text_data),How can i make that?@yangzhao1230 commented on GitHub (Nov 19, 2022):
Hi,
I have the same question as well. I wonder have you sloved it?
@Cola-any commented on GitHub (Nov 21, 2022):
Sure. You can locate the library file "from transformers import CLIPModel".
Then you may find the following code,
We see that text_outputs[1] is raw output text_features. Modify the code as follow,
So you get word_features here.