mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #409] How to Access the CLIP-pre-trained model KQV values? #349
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#349
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 @dmrangak on GitHub (Dec 11, 2023).
Original GitHub issue: https://github.com/openai/CLIP/issues/409
hi,
i am working with a CLIP-pre-trained model. To develop my algorithm, I want to access the KQV values. How should I access these values within this model? i use this pre-trained model
from PIL import Image
import requests
from transformers import CLIPProcessor, CLIPModel
model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
@data-node commented on GitHub (Apr 29, 2024):
Assuming you want the KQV for layer number zero (0-11), then do this: