flosstradamus commited on
Commit
20f7ede
·
1 Parent(s): d637b83

Update app_multi.py

Browse files
Files changed (1) hide show
  1. 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
- # 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
- # If your model checkpoint is not too large, this line can be useful for understanding the structure of your model.
102
- # If the output is too large to be useful, you might want to remove or comment it out.
103
- for key, value in cpt.items():
104
- print(f"{key}: {type(value)}") # This will print out the type of each item in the cpt dictionary.
105
-
106
- # Check if the 'config' key exists before trying to access it
107
- if 'config' in cpt:
108
- tgt_sr = cpt['config'][-1]
109
- cpt['config'][-3] = cpt['weight']['emb_g.weight'].shape[0] # n_spk
110
- else:
111
- print(f"Warning: Model {model_name} does not have a 'config' key. Skipping this model.")
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