Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,25 @@ from models.base_models import UserInput, SearchQuery
|
|
| 12 |
import logging
|
| 13 |
import asyncio
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Configure logging
|
| 16 |
logging.basicConfig(
|
| 17 |
level=logging.INFO,
|
|
@@ -23,17 +42,7 @@ logging.basicConfig(
|
|
| 23 |
)
|
| 24 |
logger = logging.getLogger(__name__)
|
| 25 |
|
| 26 |
-
# Initialize FastAPI app
|
| 27 |
-
app = FastAPI(title="Bofrost Chat API", version="2.0.0")
|
| 28 |
|
| 29 |
-
# Add CORS middleware
|
| 30 |
-
app.add_middleware(
|
| 31 |
-
CORSMiddleware,
|
| 32 |
-
allow_origins=["*"],
|
| 33 |
-
allow_credentials=True,
|
| 34 |
-
allow_methods=["*"],
|
| 35 |
-
allow_headers=["*"],
|
| 36 |
-
)
|
| 37 |
|
| 38 |
# Initialize services
|
| 39 |
model_service = ModelService()
|
|
|
|
| 12 |
import logging
|
| 13 |
import asyncio
|
| 14 |
|
| 15 |
+
# Initialize FastAPI app
|
| 16 |
+
app = FastAPI()
|
| 17 |
+
|
| 18 |
+
# Add CORS middleware
|
| 19 |
+
app.add_middleware(
|
| 20 |
+
CORSMiddleware,
|
| 21 |
+
allow_origins=["*"],
|
| 22 |
+
allow_credentials=True,
|
| 23 |
+
allow_methods=["*"],
|
| 24 |
+
allow_headers=["*"],
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# Index URLs on app startup
|
| 29 |
+
@app.on_event("startup")
|
| 30 |
+
async def startup():
|
| 31 |
+
print("donee.... ")
|
| 32 |
+
|
| 33 |
+
|
| 34 |
# Configure logging
|
| 35 |
logging.basicConfig(
|
| 36 |
level=logging.INFO,
|
|
|
|
| 42 |
)
|
| 43 |
logger = logging.getLogger(__name__)
|
| 44 |
|
|
|
|
|
|
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# Initialize services
|
| 48 |
model_service = ModelService()
|