File size: 244 Bytes
547b48b
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from transformers import pipeline

# 加载模型
#model = pipeline('text-classification')

def predict(text):
    try:
        result = text + ' is a good movie'
        return result
    except Exception as e:
        return {'error': str(e)}