Spaces:
No application file
No application file
from transformers import pipeline | |
from fastapi import FastAPI | |
app = FastAPI() | |
pipe = pipeline("text2text-generation", model="google/flan-t5-small") | |
def home(): | |
return "hello world" | |
def generate(text:str): | |
res = pipe(text) | |
return {"output":res[0]['generated_text']} | |