Spaces:
No application file
No application file
File size: 336 Bytes
47bdc14 0de15cd 47bdc14 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from transformers import pipeline
from fastapi import FastAPI
app = FastAPI()
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
@app.get("/")
def home():
return "hello world"
@app.get("/generate")
def generate(text:str):
res = pipe(text)
return {"output":res[0]['generated_text']}
|