Arts-of-coding's picture
Update app.py
42bac06
raw
history blame
626 Bytes
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()