File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515now_dir = os .getcwd ()
1616sys .path .append (now_dir )
17- from config import Config
17+ from config import Config as MyConfig
1818
19- is_half = Config ().is_half
19+ is_half = MyConfig ().is_half
2020import PySimpleGUI as sg
2121import sounddevice as sd
2222import noisereduce as nr
@@ -48,6 +48,7 @@ def __init__(
4848 初始化
4949 """
5050 try :
51+ self .config = MyConfig ()
5152 self .f0_up_key = key
5253 self .time_step = 160 / 16000 * 1000
5354 self .f0_min = 50
@@ -80,17 +81,18 @@ def __init__(
8081 cpt ["config" ][- 3 ] = cpt ["weight" ]["emb_g.weight" ].shape [0 ] # n_spk
8182 self .if_f0 = cpt .get ("f0" , 1 )
8283 self .version = cpt .get ("version" , "v1" )
83- if version == "v1" :
84- if if_f0 == 1 :
84+
85+ if self .version == "v1" :
86+ if self .if_f0 == 1 :
8587 self .net_g = SynthesizerTrnMs256NSFsid (
86- * cpt ["config" ], is_half = config .is_half
88+ * cpt ["config" ], is_half = self . config .is_half
8789 )
8890 else :
8991 self .net_g = SynthesizerTrnMs256NSFsid_nono (* cpt ["config" ])
90- elif version == "v2" :
91- if if_f0 == 1 :
92+ elif self . version == "v2" :
93+ if self . if_f0 == 1 :
9294 self .net_g = SynthesizerTrnMs768NSFsid (
93- * cpt ["config" ], is_half = config .is_half
95+ * cpt ["config" ], is_half = self . config .is_half
9496 )
9597 else :
9698 self .net_g = SynthesizerTrnMs768NSFsid_nono (* cpt ["config" ])
You can’t perform that action at this time.
0 commit comments