valeriol29 commited on
Commit
8a9ba13
1 Parent(s): abe3b35

Update README.md

Browse files

Add some comments on pooling layer initialization according to https://github.com/huggingface/transformers/issues/25377#issuecomment-2164986543 🤗

cc

@amyeroberts


@nielsr

Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -41,7 +41,10 @@ url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
41
  image = Image.open(requests.get(url, stream=True).raw)
42
 
43
  processor = ViTImageProcessor.from_pretrained('facebook/dino-vits16')
44
- model = ViTModel.from_pretrained('facebook/dino-vits16')
 
 
 
45
 
46
  inputs = processor(images=image, return_tensors="pt")
47
  outputs = model(**inputs)
 
41
  image = Image.open(requests.get(url, stream=True).raw)
42
 
43
  processor = ViTImageProcessor.from_pretrained('facebook/dino-vits16')
44
+ model = ViTModel.from_pretrained(
45
+ 'facebook/dino-vits16',
46
+ add_pooling_layer=True # Whether to initialize the ViTPooler module. Set it to 'False' to load only the backbone. 🤗
47
+ )
48
 
49
  inputs = processor(images=image, return_tensors="pt")
50
  outputs = model(**inputs)