Spaces:
Sleeping
Sleeping
mount
Browse files- app/main.py +4 -0
app/main.py
CHANGED
|
@@ -9,6 +9,8 @@ from fastapi import FastAPI, HTTPException
|
|
| 9 |
from fastapi.middleware.cors import CORSMiddleware
|
| 10 |
from pydantic import BaseModel
|
| 11 |
from contextlib import asynccontextmanager
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# New import for the pre-trained model
|
| 14 |
from huggingface_hub import from_pretrained_keras
|
|
@@ -63,6 +65,8 @@ app = FastAPI(lifespan=lifespan)
|
|
| 63 |
# --- CORS Middleware ---
|
| 64 |
app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"])
|
| 65 |
|
|
|
|
|
|
|
| 66 |
# --- Constants ---
|
| 67 |
IMAGE_DIR = Path("static/images")
|
| 68 |
|
|
|
|
| 9 |
from fastapi.middleware.cors import CORSMiddleware
|
| 10 |
from pydantic import BaseModel
|
| 11 |
from contextlib import asynccontextmanager
|
| 12 |
+
from fastapi.staticfiles import StaticFiles
|
| 13 |
+
|
| 14 |
|
| 15 |
# New import for the pre-trained model
|
| 16 |
from huggingface_hub import from_pretrained_keras
|
|
|
|
| 65 |
# --- CORS Middleware ---
|
| 66 |
app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"])
|
| 67 |
|
| 68 |
+
app.mount("/static", StaticFiles(directory="static"), name="static")
|
| 69 |
+
|
| 70 |
# --- Constants ---
|
| 71 |
IMAGE_DIR = Path("static/images")
|
| 72 |
|