abcd1234davidchen commited on
Commit
7d6eeac
·
verified ·
1 Parent(s): 094bb1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -14,10 +14,9 @@ base_model = AutoModel.from_pretrained(checkpoint)
14
 
15
  model = StanceClassifier(base_model, num_classes=3)
16
 
17
- if not os.path.exists("stance_classifier.pth"):
18
- dict_path = huggingface_hub.hf_hub_download(repo_id="abcd1234davidchen/PolStanceBERT", filename="stance_classifier.pth",local_dir=".",local_dir_use_symlinks=False)
19
 
20
- model.load_state_dict(torch.load("stance_classifier.pth", map_location=torch.device('cpu')))
21
  model.eval()
22
  labels = ['KMT', 'DPP', 'Neutral']
23
 
 
14
 
15
  model = StanceClassifier(base_model, num_classes=3)
16
 
17
+ dict_path = huggingface_hub.hf_hub_download(repo_id="abcd1234davidchen/PolStanceBERT",filename="stance_classifier.pth",local_dir=".",local_dir_use_symlinks=False)
 
18
 
19
+ model.load_state_dict(torch.load(dict_path, map_location=torch.device('cpu')))
20
  model.eval()
21
  labels = ['KMT', 'DPP', 'Neutral']
22