Spaces:
Sleeping
Sleeping
File size: 318 Bytes
15231c2 59352cb 15231c2 319fe49 15231c2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import gradio as gr
from transformers import pipeline
# 加载模型
classifier = pipeline("text-classification", model="suredream/ml-cicd-demo")
# 定义预测函数
def predict(text):
return classifier(text)[0]['label']
# 创建 Gradio 接口
gr.Interface(fn=predict, inputs="text", outputs="label").launch()
|