Someshfengde commited on
Commit
bcf50c6
1 Parent(s): a139ac6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. script.py +3 -3
script.py CHANGED
@@ -8,7 +8,7 @@ import torchvision.transforms as T
8
  from PIL import Image
9
  import torch
10
  from transformers import AutoImageProcessor
11
- from submission.create_model import HieraForImageClassification
12
  #%%
13
  # %%
14
 
@@ -28,8 +28,8 @@ class PytorchWorker:
28
  self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
29
  print(f"Using devide: {self.device}")
30
 
31
- image_processor = AutoImageProcessor.from_pretrained("./submission/hiera_model/")
32
- model = HieraForImageClassification.from_pretrained("./submission/hiera_model/", num_labels =1784 ).to(self.device).eval()
33
 
34
  return model, image_processor
35
 
 
8
  from PIL import Image
9
  import torch
10
  from transformers import AutoImageProcessor
11
+ from create_model import HieraForImageClassification
12
  #%%
13
  # %%
14
 
 
28
  self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
29
  print(f"Using devide: {self.device}")
30
 
31
+ image_processor = AutoImageProcessor.from_pretrained("./hiera_model/")
32
+ model = HieraForImageClassification.from_pretrained("./hiera_model/", num_labels =1784 ).to(self.device).eval()
33
 
34
  return model, image_processor
35