VIKRAM989 commited on
Commit
4e28109
·
verified ·
1 Parent(s): bbb3941

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +6 -1
model.py CHANGED
@@ -8,6 +8,8 @@ import sys
8
  import os
9
  import re
10
  from collections import Counter
 
 
11
 
12
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13
 
@@ -190,7 +192,10 @@ def main():
190
 
191
  # Get the directory where this script is located
192
  script_dir = os.path.dirname(os.path.abspath(__file__))
193
- CHECKPOINT_PATH = os.path.join(script_dir, "best_checkpoint.pth")
 
 
 
194
  VOCAB_PATH = os.path.join(script_dir, "vocab.pkl")
195
 
196
  # load vocab
 
8
  import os
9
  import re
10
  from collections import Counter
11
+ from huggingface_hub import hf_hub_download
12
+
13
 
14
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
 
 
192
 
193
  # Get the directory where this script is located
194
  script_dir = os.path.dirname(os.path.abspath(__file__))
195
+ CHECKPOINT_PATH = hf_hub_download(
196
+ repo_id="VIKRAM989/image-label",
197
+ filename="best_checkpoint.pth"
198
+ )
199
  VOCAB_PATH = os.path.join(script_dir, "vocab.pkl")
200
 
201
  # load vocab