Commit
·
bf9283b
1
Parent(s):
b9c5154
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from dotenv import load_dotenv
|
| 3 |
+
from subprocess import Popen
|
| 4 |
+
import shutil
|
| 5 |
+
import gradio as gr
|
| 6 |
+
|
| 7 |
+
load_dotenv()
|
| 8 |
+
|
| 9 |
+
my_env = os.environ.copy()
|
| 10 |
+
#
|
| 11 |
+
# Please set your username and your Space name
|
| 12 |
+
#
|
| 13 |
+
my_env["HF_SPACE"] = "embed/Arts-of-coding/Corneal_meta-atlas"
|
| 14 |
+
command = ["ls", "-a","/home/user/.local/lib/python3.8/site-packages/gradio"]
|
| 15 |
+
print(command)
|
| 16 |
+
worker = Popen(command)
|
| 17 |
+
worker.wait()
|
| 18 |
+
command = ["mercury", "clearsessions"]
|
| 19 |
+
print(command)
|
| 20 |
+
worker = Popen(command)
|
| 21 |
+
worker.wait()
|
| 22 |
+
command = ["mercury", "run", f"0.0.0.0:{os.environ.get('PORT', 7860)}"]
|
| 23 |
+
print(command)
|
| 24 |
+
worker = Popen(command, env=my_env)
|
| 25 |
+
worker.wait()
|