File size: 626 Bytes
2a7a3d9
 
 
7c65d90
15408c8
155a9b0
2a7a3d9
 
 
 
 
35e124d
8a403ee
9d3ce51
5d4c8c8
 
 
a86702d
 
 
 
2a7a3d9
 
 
f293057
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
from dotenv import load_dotenv
from subprocess import Popen
import shutil
import gradio as gr

load_dotenv()

my_env = os.environ.copy()
#
# Please set your username and your Space name
#
my_env["HF_SPACE"] = "embed/Arts-of-coding/Corneal_meta-atlas"
command = ["ls", "-a","/home/user/.local/lib/python3.8/site-packages/gradio"] 
print(command)
worker = Popen(command) 
worker.wait()
command = ["mercury", "clearsessions"] 
print(command)
worker = Popen(command) 
worker.wait()
command = ["mercury", "run", f"0.0.0.0:{os.environ.get('PORT', 7860)}"] 
print(command)
worker = Popen(command, env=my_env) 
worker.wait()