aiuser / app.py
binsan's picture
hi
d9355ac
raw
history blame
341 Bytes
from fastapi import FastAPI
from transformers import pipeline
classifier = pipeline("zero-shot-classification")
app = FastAPI()
@app.get("/")
def greet_json():
j = classifier(
"This is a course about the Transformers library",
candidate_labels=["education", "politics", "business"],
)
return {"Hello": str(j)}