Spaces:
Runtime error
Runtime error
from fastapi import FastAPI | |
from fastapi.staticfiles import StaticFiles | |
from fastapi.responses import FileResponse | |
from transformers import pipeline | |
app = FastAPI() | |
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small") | |
def index() -> FileResponse: | |
return {"hello":"world"} | |
def t5(input): | |
output = pipe_flan(input) | |
return {"output": output[0]["generated_text"]} |