import os from dotenv import load_dotenv from subprocess import Popen load_dotenv() my_env = os.environ.copy() # # Please set your username and your Space name # my_env["HF_SPACE"] = "embed/NSC9/Artificial_Calculus_Teacher" command = ["mercury", "run", f"0.0.0.0:{os.environ.get('PORT', 7860)}"] print(command) worker = Popen(command, env=my_env) worker.wait()