Create hf_start.py
Browse files- hf_start.py +12 -0
hf_start.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from api.src.main import app
|
2 |
+
from fastapi.staticfiles import StaticFiles
|
3 |
+
from fastapi.responses import RedirectResponse
|
4 |
+
|
5 |
+
# Add root redirect to web UI
|
6 |
+
@app.get("/")
|
7 |
+
async def root():
|
8 |
+
return RedirectResponse(url="/web/")
|
9 |
+
|
10 |
+
if __name__ == "__main__":
|
11 |
+
import uvicorn
|
12 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|