fixed startup
Browse files
run.py
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
1 |
import subprocess
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
import subprocess
|
3 |
|
4 |
+
|
5 |
+
on_hf_spaces = os.getenv("ON_HF_SPACES")
|
6 |
+
host = "0.0.0.0" if on_hf_spaces else "localhost"
|
7 |
+
|
8 |
+
subprocess.run(f"uvicorn app.main:app --host {host} --port 7860", shell=True)
|