text_classify / app.py
aimaswx's picture
Create app.py
9fa8f6d
raw
history blame
261 Bytes
# 导入gradio
import gradio as gr
# 导入transformers相关包
from transformers import *
# 通过Interface加载pipeline并启动服务
gr.Interface.from_pipeline(pipeline("text-classification", model="uer/roberta-base-finetuned-dianping-chinese")).launch()