SuCicada commited on
Commit
8201352
1 Parent(s): df35458

enable cache

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import subprocess
3
  import sys
4
 
 
5
  # Run shell command and capture output in real-time
6
  def init():
7
  process = subprocess.Popen("""
@@ -18,12 +19,19 @@ def init():
18
  return_code = process.poll()
19
  print(f"Command exited with return code {return_code}")
20
 
21
- init()
22
- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "SuTTS/test")))
23
- # sys.path.append("/Users/peng/PROGRAM/GitHub/SuTTS/test")
24
 
25
- print(sys.path)
 
 
 
 
 
 
 
26
 
 
 
27
  from sovits_gradio import VitsGradio
 
28
  grVits = VitsGradio()
29
- grVits.Vits.launch(debug=True)
 
2
  import subprocess
3
  import sys
4
 
5
+
6
  # Run shell command and capture output in real-time
7
  def init():
8
  process = subprocess.Popen("""
 
19
  return_code = process.poll()
20
  print(f"Command exited with return code {return_code}")
21
 
 
 
 
22
 
23
+ is_space = os.getenv("SYSTEM") == "spaces"
24
+ if is_space:
25
+ init()
26
+
27
+ if is_space:
28
+ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "SuTTS/test")))
29
+ else:
30
+ sys.path.append("/Users/peng/PROGRAM/GitHub/SuTTS/test")
31
 
32
+ print(sys.path)
33
+ os.environ['USE_CACHE_INFERENCE_AUDIO'] = "True"
34
  from sovits_gradio import VitsGradio
35
+
36
  grVits = VitsGradio()
37
+ grVits.Vits.launch()