from fastapi import FastAPI from fastapi.staticfiles import StaticFiles from fastapi.responses import FileResponse from transformers import pipeline app = FastAPI() pipe_ocr = pipeline("text0recognition", model="naver-clova-ocr/bros-base-uncased") app.mount("/", StaticFiles(directory="static", html=True), name="static") @app.get("/") def index() -> FileResponse: return FileResponse(path="/app/static/index.html", media_type="text/html") @app.get("/ocr") def ocr(input): result = pipe_ocr(input) print(result)