File size: 261 Bytes
9fa8f6d
 
 
 
 
 
 
1
2
3
4
5
6
7
# 导入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()