edadaltocg commited on
Commit
af39f3c
1 Parent(s): a8ee931

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -3
README.md CHANGED
@@ -34,10 +34,19 @@ This model is a small timm/vit_base_patch16_224.orig_in21k_ft_in1k trained on ci
34
  Use the code below to get started with the model.
35
 
36
  ```python
37
- import detectors
38
  import timm
39
-
40
- model = timm.create_model("vit_base_patch16_224_in21k_ft_cifar10", pretrained=True)
 
 
 
 
 
 
 
 
 
 
41
  ```
42
 
43
  ## Training Data
 
34
  Use the code below to get started with the model.
35
 
36
  ```python
 
37
  import timm
38
+ import torch
39
+ from torch import nn
40
+
41
+ model = timm.create_model("timm/vit_base_patch16_224.orig_in21k_ft_in1k", pretrained=False)
42
+ model.head = nn.Linear(model.head.in_features, 10)
43
+ model.load_state_dict(
44
+ torch.hub.load_state_dict_from_url(
45
+ "https://huggingface.co/edadaltocg/vit_base_patch16_224_in21k_ft_cifar10/resolve/main/pytorch_model.bin",
46
+ map_location="cpu",
47
+ file_name="vit_base_patch16_224_in21k_ft_cifar10.pth",
48
+ )
49
+ )
50
  ```
51
 
52
  ## Training Data