SuCicada commited on
Commit
284b465
·
1 Parent(s): fb8f46c
Files changed (3) hide show
  1. .gitignore +2 -0
  2. app.py +25 -0
  3. run.sh +18 -0
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ .idea
2
+ *.iml
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
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("""
9
+ bash run.sh
10
+ """, stdout=subprocess.PIPE, shell=True)
11
+ while True:
12
+ output = process.stdout.readline().decode()
13
+ if output == '' and process.poll() is not None:
14
+ break
15
+ if output:
16
+ print(output.strip())
17
+
18
+ # Wait for the command to finish and get the return code
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()
run.sh ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ project=project
3
+ if [ -d "$project" ]; then
4
+ echo "$project already exists"
5
+ cd $project
6
+ git pull --recurse-submodules
7
+ git submodule update --recursive
8
+ git submodule sync
9
+ else
10
+ git clone https://github.com/SuCicada/so-vits-svc.git -b 4.0 --recurse-submodules $project
11
+ cd $project
12
+ fi
13
+
14
+ pip install -r requirements.txt
15
+
16
+ wget https://huggingface.co/SuCicada/Lain-so-vits-svc-4.0/resolve/main/config.json
17
+ wget https://huggingface.co/SuCicada/Lain-so-vits-svc-4.0/resolve/main/G_256800_infer.pth
18
+ python tools/vits_gradio.py --model_path G_256800_infer.pth --config_path config.json