Spaces:
Runtime error
Runtime error
Update app_multi.py
Browse files- app_multi.py +14 -18
app_multi.py
CHANGED
@@ -103,28 +103,24 @@ for model_name in multi_cfg.get('models'):
|
|
103 |
else:
|
104 |
net_g = SynthesizerTrnMs768NSFsid_nono(*cpt['config'])
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
del net_g.enc_q
|
109 |
|
110 |
-
|
111 |
-
|
112 |
|
113 |
-
|
114 |
-
|
115 |
|
116 |
-
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
else:
|
127 |
-
print("Skip one module, because is too big")
|
128 |
|
129 |
print(f'Models loaded: {len(loaded_models)}')
|
130 |
|
|
|
103 |
else:
|
104 |
net_g = SynthesizerTrnMs768NSFsid_nono(*cpt['config'])
|
105 |
|
106 |
+
del net_g.enc_q
|
|
|
|
|
107 |
|
108 |
+
# According to original code, this thing seems necessary.
|
109 |
+
print(net_g.load_state_dict(cpt['weight'], strict=False))
|
110 |
|
111 |
+
net_g.eval().to(config.device)
|
112 |
+
net_g = net_g.half() if util.is_half(config.device) else net_g.float()
|
113 |
|
114 |
+
vc = VC(tgt_sr, config)
|
115 |
|
116 |
+
loaded_models.append(dict(
|
117 |
+
name=model_name,
|
118 |
+
metadata=model_info,
|
119 |
+
vc=vc,
|
120 |
+
net_g=net_g,
|
121 |
+
if_f0=if_f0,
|
122 |
+
target_sr=tgt_sr
|
123 |
+
))
|
|
|
|
|
124 |
|
125 |
print(f'Models loaded: {len(loaded_models)}')
|
126 |
|