Spaces:
Runtime error
Runtime error
Try a fixe
Browse files- app_multi.py +7 -0
app_multi.py
CHANGED
|
@@ -103,6 +103,13 @@ for model_name in multi_cfg.get('models'):
|
|
| 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.
|
|
|
|
| 103 |
else:
|
| 104 |
net_g = SynthesizerTrnMs768NSFsid_nono(*cpt['config'])
|
| 105 |
|
| 106 |
+
if 'enc_p.emb_phone.weight' in cpt['weight']:
|
| 107 |
+
old_shape = cpt['weight']['enc_p.emb_phone.weight'].shape
|
| 108 |
+
new_shape = net_g.enc_p.emb_phone.weight.shape
|
| 109 |
+
if old_shape != new_shape:
|
| 110 |
+
print(f"Resizing enc_p.emb_phone.weight: {old_shape} -> {new_shape}")
|
| 111 |
+
cpt['weight']['enc_p.emb_phone.weight'] = cpt['weight']['enc_p.emb_phone.weight'][:new_shape[0], :new_shape[1]]
|
| 112 |
+
|
| 113 |
del net_g.enc_q
|
| 114 |
|
| 115 |
# According to original code, this thing seems necessary.
|