from fastapi import FastAPI | |
from transformers import pipeline | |
classifier = pipeline("zero-shot-classification") | |
app = FastAPI() | |
def greet_json(): | |
j = classifier( | |
"This is a course about the Transformers library", | |
candidate_labels=["education", "politics", "business"], | |
) | |
return {"Hello": str(j)} |