sid_rath / app.py
HTAR5's picture
Update app.py
5f6a25a verified
raw
history blame
347 Bytes
from fastapi import FastAPI
from transformers import pipeline
app = FastAPI()
pipe = pipeline("text-classification", model="FacebookAI/roberta-large-mnli")
# @app.get("/")
# def home():
# return{"message":"hello rath"}
@app.get("/genrate")
def gentxt(text : str):
output = pipe(text)
return({"output":output[0]["generated_text"]})