File size: 597 Bytes
6e7a2fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
HuggingFace Spaces entry point.
Imports the real server and runs it on port 7860 (HF default).
Adds a root redirect to /explore since only the KG Explorer is deployed.
"""
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent.resolve()))

from core.web.server import create_app
from fastapi.responses import RedirectResponse
import uvicorn

app = create_app()

@app.get("/", include_in_schema=False)
async def root_redirect():
    return RedirectResponse(url="/explore")

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=7860, log_level="info")