File size: 940 Bytes
cde3c46 f97d08b cde3c46 b1588e7 8201352 cde3c46 8201352 cde3c46 8201352 cde3c46 8201352 cde3c46 8201352 |
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 26 27 28 29 30 31 32 33 34 35 36 37 38 |
import os
import subprocess
import sys
# Run shell command and capture output in real-time
def init():
process = subprocess.Popen("""
bash run.sh
""", stdout=subprocess.PIPE, shell=True)
while True:
output = process.stdout.readline().decode()
if output == '' and process.poll() is not None:
break
if output:
print(output.strip())
# Wait for the command to finish and get the return code
return_code = process.poll()
print(f"Command exited with return code {return_code}")
is_space = os.getenv("SYSTEM") == "spaces"
if is_space:
init()
if is_space:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "SuTTS/test")))
else:
sys.path.append("/Users/peng/PROGRAM/GitHub/SuTTS/test")
print(sys.path)
os.environ['USE_CACHE_INFERENCE_AUDIO'] = "True"
from sovits_gradio import VitsGradio
grVits = VitsGradio()
grVits.Vits.launch()
|