David Thomas
commited on
Commit
·
a623780
1
Parent(s):
b175518
bug fix
Browse files
app.py
CHANGED
@@ -19,16 +19,30 @@ os.makedirs(os.path.join(now_dir, "weights"), exist_ok=True)
|
|
19 |
os.environ["TEMP"] = tmp
|
20 |
warnings.filterwarnings("ignore")
|
21 |
torch.manual_seed(114514)
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
from i18n import I18nAuto
|
23 |
-
|
24 |
import signal
|
25 |
-
|
26 |
import math
|
27 |
-
|
28 |
from utils import load_audio, CSVutil
|
29 |
|
30 |
global DoFormant, Quefrency, Timbre
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
if not os.path.isdir('csvdb/'):
|
33 |
os.makedirs('csvdb')
|
34 |
frmnt, stp = open("csvdb/formanting.csv", 'w'), open("csvdb/stop.csv", 'w')
|
@@ -158,7 +172,7 @@ def update_fshift_presets(preset, qfrency, tmbre):
|
|
158 |
{"value": tmbre, "__type__": "update"},
|
159 |
)
|
160 |
|
161 |
-
|
162 |
#i18n.print()
|
163 |
# Determine if there are N cards that can be used to train and accelerate inference
|
164 |
ngpu = torch.cuda.device_count()
|
@@ -213,20 +227,10 @@ from lib.infer_pack.models import (
|
|
213 |
SynthesizerTrnMs768NSFsid,
|
214 |
SynthesizerTrnMs768NSFsid_nono,
|
215 |
)
|
216 |
-
import soundfile as sf
|
217 |
-
from fairseq import checkpoint_utils
|
218 |
-
import gradio as gr
|
219 |
-
import logging
|
220 |
-
from vc_infer_pipeline import VC
|
221 |
-
from config import Config
|
222 |
|
223 |
-
config = Config()
|
224 |
-
cpt=None
|
225 |
# from trainset_preprocess_pipeline import PreProcess
|
226 |
logging.getLogger("numba").setLevel(logging.WARNING)
|
227 |
|
228 |
-
hubert_model = None
|
229 |
-
|
230 |
def load_hubert():
|
231 |
global hubert_model
|
232 |
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
@@ -241,14 +245,6 @@ def load_hubert():
|
|
241 |
hubert_model = hubert_model.float()
|
242 |
hubert_model.eval()
|
243 |
|
244 |
-
|
245 |
-
weight_root = "weights"
|
246 |
-
index_root = "logs"
|
247 |
-
names = []
|
248 |
-
index_paths = ["./logs/joel/added_IVF479_Flat_nprobe_1.index","./logs/jenny/added_IVF533_Flat_nprobe_1.index"]
|
249 |
-
file_index=None
|
250 |
-
|
251 |
-
|
252 |
# Define a function to calculate a "similarity score" to identify potential copyright infringement
|
253 |
def calculate_similarity_score(
|
254 |
audio0,
|
@@ -1557,7 +1553,7 @@ def zip_downloader(model):
|
|
1557 |
else:
|
1558 |
return f'./weights/{model}.pth', "Could not find Index file."
|
1559 |
|
1560 |
-
with gr.Blocks(
|
1561 |
global person
|
1562 |
with gr.Tabs():
|
1563 |
with gr.TabItem("Inference"):
|
|
|
19 |
os.environ["TEMP"] = tmp
|
20 |
warnings.filterwarnings("ignore")
|
21 |
torch.manual_seed(114514)
|
22 |
+
import soundfile as sf
|
23 |
+
from fairseq import checkpoint_utils
|
24 |
+
import gradio as gr
|
25 |
+
import logging
|
26 |
+
from vc_infer_pipeline import VC
|
27 |
+
from config import Config
|
28 |
from i18n import I18nAuto
|
|
|
29 |
import signal
|
|
|
30 |
import math
|
|
|
31 |
from utils import load_audio, CSVutil
|
32 |
|
33 |
global DoFormant, Quefrency, Timbre
|
34 |
|
35 |
+
|
36 |
+
i18n = I18nAuto()
|
37 |
+
config = Config()
|
38 |
+
weight_root = "weights"
|
39 |
+
index_root = "logs"
|
40 |
+
names = []
|
41 |
+
index_paths = ["./logs/joel/added_IVF479_Flat_nprobe_1.index","./logs/jenny/added_IVF533_Flat_nprobe_1.index"]
|
42 |
+
file_index=None
|
43 |
+
|
44 |
+
hubert_model = None
|
45 |
+
|
46 |
if not os.path.isdir('csvdb/'):
|
47 |
os.makedirs('csvdb')
|
48 |
frmnt, stp = open("csvdb/formanting.csv", 'w'), open("csvdb/stop.csv", 'w')
|
|
|
172 |
{"value": tmbre, "__type__": "update"},
|
173 |
)
|
174 |
|
175 |
+
|
176 |
#i18n.print()
|
177 |
# Determine if there are N cards that can be used to train and accelerate inference
|
178 |
ngpu = torch.cuda.device_count()
|
|
|
227 |
SynthesizerTrnMs768NSFsid,
|
228 |
SynthesizerTrnMs768NSFsid_nono,
|
229 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
|
|
|
|
|
231 |
# from trainset_preprocess_pipeline import PreProcess
|
232 |
logging.getLogger("numba").setLevel(logging.WARNING)
|
233 |
|
|
|
|
|
234 |
def load_hubert():
|
235 |
global hubert_model
|
236 |
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
|
|
245 |
hubert_model = hubert_model.float()
|
246 |
hubert_model.eval()
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
# Define a function to calculate a "similarity score" to identify potential copyright infringement
|
249 |
def calculate_similarity_score(
|
250 |
audio0,
|
|
|
1553 |
else:
|
1554 |
return f'./weights/{model}.pth', "Could not find Index file."
|
1555 |
|
1556 |
+
with gr.Blocks(title='RVC RULE1 v1', theme='step-3-profit/Midnight-Deep@=0.0.2') as app:
|
1557 |
global person
|
1558 |
with gr.Tabs():
|
1559 |
with gr.TabItem("Inference"):
|