Spaces:
Paused
Paused
Commit
·
a9b4192
1
Parent(s):
6a24fb7
update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,20 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import subprocess
|
3 |
|
4 |
+
if __name__ == "__main__":
|
5 |
+
# Ensure the /data directory exists
|
6 |
+
os.makedirs("/data/mlruns", exist_ok=True)
|
7 |
+
os.makedirs("/data", exist_ok=True)
|
8 |
|
9 |
+
# Optional: Set permissions (be cautious with permissions in production)
|
10 |
+
os.chmod("/data", 0o777)
|
11 |
+
os.chmod("/data/mlruns", 0o777)
|
12 |
+
|
13 |
+
# Start the MLflow server
|
14 |
+
subprocess.run([
|
15 |
+
"mlflow", "server",
|
16 |
+
"--backend-store-uri", "sqlite:////data/mlflow.db",
|
17 |
+
"--default-artifact-root", "/data/mlruns",
|
18 |
+
"--host", "0.0.0.0",
|
19 |
+
"--port", "7860"
|
20 |
+
])
|