suredream commited on
Commit
319fe49
·
verified ·
1 Parent(s): 59352cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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()