Spaces:
Running
Running
File size: 539 Bytes
f9ac587 84bb476 f9ac587 84bb476 f9ac587 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | from contextlib import asynccontextmanager
from fastapi import FastAPI
from .core.model_loader import load_model
from .api import inference, meta
from .web import pages
@asynccontextmanager
async def lifespan(app: FastAPI):
load_model()
yield
app = FastAPI(
title="SMS Classifier API",
description="Classifies SMS messages into categories using fine-tuned DistilBERT.",
version="2.0.0",
lifespan=lifespan,
)
app.include_router(pages.router)
app.include_router(inference.router)
app.include_router(meta.router)
|