Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from dotenv import load_dotenv
|
3 |
+
from subprocess import Popen
|
4 |
+
load_dotenv()
|
5 |
+
|
6 |
+
|
7 |
+
my_env = os.environ.copy()
|
8 |
+
#
|
9 |
+
# Please set your username and your Space name
|
10 |
+
#
|
11 |
+
my_env["HF_SPACE"] = "embed/pplonski/interactive-presentation"
|
12 |
+
|
13 |
+
command = ["mercury", "run", f"0.0.0.0:{os.environ.get('PORT', 7860)}"]
|
14 |
+
print(command)
|
15 |
+
worker = Popen(command, env=my_env)
|
16 |
+
worker.wait()
|