Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,22 @@
|
|
1 |
-
from model import DepressionClassifier
|
2 |
-
|
3 |
import gradio as gr
|
4 |
import numpy as np
|
5 |
-
|
6 |
-
#import requests
|
7 |
|
8 |
import hopsworks
|
9 |
import joblib
|
10 |
-
|
11 |
|
12 |
-
project = hopsworks.login(project='liangc40')
|
13 |
#fs = project.get_feature_store()
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
#model =
|
20 |
|
21 |
def analyse(text):
|
22 |
-
label =
|
23 |
return label
|
24 |
|
25 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
+
from transformers import pipeline
|
|
|
4 |
|
5 |
import hopsworks
|
6 |
import joblib
|
7 |
+
pipe = pipeline(model="liangc40/sentimental_analysis")
|
8 |
|
9 |
+
#project = hopsworks.login(project='liangc40')
|
10 |
#fs = project.get_feature_store()
|
11 |
|
12 |
+
|
13 |
+
#mr = project.get_model_registry()
|
14 |
+
#model = mr.get_model("sentimental_analysis_model", version=1)
|
15 |
+
#model_dir = model.download()
|
16 |
+
#model = joblib.load(model_dir + "/sentimental_analysis_model.pkl")
|
17 |
|
18 |
def analyse(text):
|
19 |
+
label = pipe(text)
|
20 |
return label
|
21 |
|
22 |
with gr.Blocks() as demo:
|