Julian Bilcke
commited on
Commit
·
0de48cd
1
Parent(s):
a10774a
up
Browse files- .gitignore +1 -0
- run_hf_space.py +8 -2
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.DS_Store
|
run_hf_space.py
CHANGED
|
@@ -11,7 +11,7 @@ import sys
|
|
| 11 |
import subprocess
|
| 12 |
import logging
|
| 13 |
import asyncio
|
| 14 |
-
from server import init_app
|
| 15 |
from aiohttp import web
|
| 16 |
|
| 17 |
# Configure logging
|
|
@@ -41,8 +41,14 @@ async def run_async():
|
|
| 41 |
|
| 42 |
logger.info(f"Initializing application with base_path='{base_path}', port={port}")
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
# Initialize the application
|
| 45 |
-
app = await init_app(base_path=base_path)
|
| 46 |
|
| 47 |
# Log all routes for debugging
|
| 48 |
routes = sorted([f"{route.method} {route.resource}" for route in app.router.routes() if hasattr(route, 'resource')])
|
|
|
|
| 11 |
import subprocess
|
| 12 |
import logging
|
| 13 |
import asyncio
|
| 14 |
+
from server import init_app, parse_args
|
| 15 |
from aiohttp import web
|
| 16 |
|
| 17 |
# Configure logging
|
|
|
|
| 41 |
|
| 42 |
logger.info(f"Initializing application with base_path='{base_path}', port={port}")
|
| 43 |
|
| 44 |
+
# Parse default args and override for HF Space
|
| 45 |
+
args = parse_args()
|
| 46 |
+
args.port = port
|
| 47 |
+
args.host = "0.0.0.0"
|
| 48 |
+
args.path = base_path
|
| 49 |
+
|
| 50 |
# Initialize the application
|
| 51 |
+
app = await init_app(args, base_path=base_path)
|
| 52 |
|
| 53 |
# Log all routes for debugging
|
| 54 |
routes = sorted([f"{route.method} {route.resource}" for route in app.router.routes() if hasattr(route, 'resource')])
|