ml-cicd-demo / app.py
suredream's picture
Update app.py
319fe49 verified
raw
history blame contribute delete
318 Bytes
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()