Spaces:
Sleeping
Sleeping
Commit ·
20f7ede
1
Parent(s): d637b83
Update app_multi.py
Browse files- app_multi.py +19 -20
app_multi.py
CHANGED
|
@@ -90,26 +90,25 @@ for model_name in multi_cfg.get('models'):
|
|
| 90 |
open(path.join('model', model_name, 'config.json'), 'r')
|
| 91 |
)
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
continue
|
| 113 |
|
| 114 |
if_f0 = cpt.get('f0', 1)
|
| 115 |
# Check the dimension of the 'enc_p.emb_phone.weight' tensor
|
|
|
|
| 90 |
open(path.join('model', model_name, 'config.json'), 'r')
|
| 91 |
)
|
| 92 |
|
| 93 |
+
# Load RVC checkpoint
|
| 94 |
+
cpt = torch.load(
|
| 95 |
+
path.join('model', model_name, model_info['model']),
|
| 96 |
+
map_location='cpu'
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
print(cpt.keys())
|
| 100 |
+
|
| 101 |
+
# Adding the loop to iterate over keys and values in the checkpoint
|
| 102 |
+
for key, value in cpt.items():
|
| 103 |
+
print(f"{key}: {type(value)}") # This will print out the type of each item in the cpt dictionary.
|
| 104 |
+
|
| 105 |
+
# Check if the 'config' key exists before trying to access it
|
| 106 |
+
if 'config' in cpt:
|
| 107 |
+
tgt_sr = cpt['config'][-1]
|
| 108 |
+
cpt['config'][-3] = cpt['weight']['emb_g.weight'].shape[0] # n_spk
|
| 109 |
+
else:
|
| 110 |
+
print(f"Warning: Model {model_name} does not have a 'config' key. Skipping this model.")
|
| 111 |
+
continue
|
|
|
|
| 112 |
|
| 113 |
if_f0 = cpt.get('f0', 1)
|
| 114 |
# Check the dimension of the 'enc_p.emb_phone.weight' tensor
|