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() | |
summarizer = pipeline("summarization", model="Falconsai/text_summarization") | |
def pre(input): | |
output = summarizer(input) | |
print(output) | |
return {"output": output[0]} | |
app.mount("/static", StaticFiles(directory="static"), name="static") | |
def index() -> FileResponse: | |
return FileResponse(path='./static/static.html', media_type="text/html") | |