Spaces:
Runtime error
Runtime error
Commit
•
88318eb
1
Parent(s):
15ed422
Update app.py
Browse files
app.py
CHANGED
@@ -8,12 +8,13 @@ model = AutoModelForSequenceClassification.from_pretrained(pretrained)
|
|
8 |
threshold = 0.5
|
9 |
|
10 |
labels = {0: 'people', 1: 'planet', 2:'profit'}
|
|
|
11 |
|
12 |
def greet(name):
|
13 |
return "Hello " + name + "!!"
|
14 |
|
15 |
def predict_text(text):
|
16 |
-
return
|
17 |
|
18 |
-
demo = gr.Interface(fn=
|
19 |
demo.launch()
|
|
|
8 |
threshold = 0.5
|
9 |
|
10 |
labels = {0: 'people', 1: 'planet', 2:'profit'}
|
11 |
+
return_labels = {'people': 0.25, 'planet':0.5, 'profit':0.75}
|
12 |
|
13 |
def greet(name):
|
14 |
return "Hello " + name + "!!"
|
15 |
|
16 |
def predict_text(text):
|
17 |
+
return return_labels
|
18 |
|
19 |
+
demo = gr.Interface(fn=predict_text, inputs="text", outputs="label")
|
20 |
demo.launch()
|