qisan commited on
Commit
635ba57
1 Parent(s): 0add02a

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -5,9 +5,17 @@ from model import DepressionClassifier
5
  import hopsworks
6
  import joblib
7
  import torch
 
 
8
  class_names = ['Not Depressed', 'Depressed']
 
 
9
  model = DepressionClassifier(len(class_names), 'bert-base-cased')
10
- model.load_state_dict(torch.load("liangc40/sentimental_analysis/model.pt"))
 
 
 
 
11
  model.eval()
12
  #pipe = pipeline(model="liangc40/sentimental_analysis")
13
 
 
5
  import hopsworks
6
  import joblib
7
  import torch
8
+ from huggingface_hub import hf_hub_download
9
+
10
  class_names = ['Not Depressed', 'Depressed']
11
+ pt_file = hf_hub_download(repo_id="liangc40/sentimental_analysis", filename="model.pt")
12
+
13
  model = DepressionClassifier(len(class_names), 'bert-base-cased')
14
+ model.load_state_dict(torch.load(pt_file))
15
+
16
+
17
+
18
+
19
  model.eval()
20
  #pipe = pipeline(model="liangc40/sentimental_analysis")
21