Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ classifier = pipeline("text-classification", model="suredream/ml-cicd-demo")
|
|
6 |
|
7 |
# 定义预测函数
|
8 |
def predict(text):
|
9 |
-
return classifier(text)
|
10 |
|
11 |
# 创建 Gradio 接口
|
12 |
gr.Interface(fn=predict, inputs="text", outputs="label").launch()
|
|
|
6 |
|
7 |
# 定义预测函数
|
8 |
def predict(text):
|
9 |
+
return classifier(text)[0]['label']
|
10 |
|
11 |
# 创建 Gradio 接口
|
12 |
gr.Interface(fn=predict, inputs="text", outputs="label").launch()
|