Manav2512's picture
Upload app.py
8373ca0 verified
raw
history blame contribute delete
353 Bytes
from fastapi import FastAPI
from transformers import pipeline
app = FastAPI()
pipe = pipeline("text2text-generation", model="MBZUAI/LaMini-T5-738M")
@app.get("/")
def home():
return {"message":"Hello World"}
@app.get("/generation")
def genrate(text:str):
output = pipe(text)
return {"output": output[0]['generated_text']}