Spaces:
Sleeping
Sleeping
abril4416 commited on
Commit ·
705511a
1
Parent(s): 68f763b
Start app with uvicorn on PORT env for Spaces
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from pathlib import Path
|
|
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
from fastapi import FastAPI
|
|
@@ -47,3 +48,9 @@ app = FastAPI()
|
|
| 47 |
app.mount("/linear-regression", StaticFiles(directory=str(linear_dir), html=True), name="linear-regression")
|
| 48 |
app.mount("/logistic-regression", StaticFiles(directory=str(logistic_dir), html=True), name="logistic-regression")
|
| 49 |
app = gr.mount_gradio_app(app, demo, path="/")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from pathlib import Path
|
| 2 |
+
import os
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
from fastapi import FastAPI
|
|
|
|
| 48 |
app.mount("/linear-regression", StaticFiles(directory=str(linear_dir), html=True), name="linear-regression")
|
| 49 |
app.mount("/logistic-regression", StaticFiles(directory=str(logistic_dir), html=True), name="logistic-regression")
|
| 50 |
app = gr.mount_gradio_app(app, demo, path="/")
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
if __name__ == "__main__":
|
| 54 |
+
import uvicorn
|
| 55 |
+
|
| 56 |
+
uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", "7860")))
|