Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
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(
|
|
|
|
|
|
|
|
|
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 |
|