Amitz244 commited on
Commit
314c8b1
·
verified ·
1 Parent(s): 2646e67

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -1
README.md CHANGED
@@ -31,11 +31,13 @@ To use the model for inference:
31
  from torchvision import transforms
32
  import torch
33
  from PIL import Image
 
34
 
35
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
36
 
37
  # Load model
38
- model = torch.load("perceptCLIP_Emotions.pth").to(device).eval()
 
39
 
40
  # Emotion label mapping
41
  idx2label = {
 
31
  from torchvision import transforms
32
  import torch
33
  from PIL import Image
34
+ from huggingface_hub import hf_hub_download
35
 
36
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
37
 
38
  # Load model
39
+ model_path = hf_hub_download(repo_id="PerceptCLIP/PerceptCLIP_Emotions", filename="perceptCLIP_Emotions.pth")
40
+ model = torch.load(model_path).to(device).eval()
41
 
42
  # Emotion label mapping
43
  idx2label = {