Spaces:
Runtime error
Runtime error
Update inference/style_transfer.py
Browse files
inference/style_transfer.py
CHANGED
@@ -171,7 +171,10 @@ class Mixing_Style_Transfer_Inference:
|
|
171 |
sf.write(os.path.join(cur_out_dir, f"{cur_inst_name}_{output_name_tag}.wav"), fin_data_out_inst.transpose(-1, -2), self.args.sample_rate, 'PCM_16')
|
172 |
# remix
|
173 |
fin_data_out_mix = sum(inst_outputs)
|
174 |
-
|
|
|
|
|
|
|
175 |
|
176 |
|
177 |
# Inference whole song
|
@@ -326,7 +329,7 @@ def set_up():
|
|
326 |
|
327 |
directory_args = parser.add_argument_group('Directory args')
|
328 |
# directory paths
|
329 |
-
directory_args.add_argument('--target_dir', type=str, default='./
|
330 |
directory_args.add_argument('--output_dir', type=str, default=None, help='if no output_dir is specified (None), the results will be saved inside the target_dir')
|
331 |
directory_args.add_argument('--input_file_name', type=str, default='input')
|
332 |
directory_args.add_argument('--reference_file_name', type=str, default='reference')
|
|
|
171 |
sf.write(os.path.join(cur_out_dir, f"{cur_inst_name}_{output_name_tag}.wav"), fin_data_out_inst.transpose(-1, -2), self.args.sample_rate, 'PCM_16')
|
172 |
# remix
|
173 |
fin_data_out_mix = sum(inst_outputs)
|
174 |
+
fin_output_path = os.path.join(cur_out_dir, f"mixture_{output_name_tag}.wav")
|
175 |
+
sf.write(fin_output_path, fin_data_out_mix.transpose(-1, -2), self.args.sample_rate, 'PCM_16')
|
176 |
+
|
177 |
+
return fin_output_path
|
178 |
|
179 |
|
180 |
# Inference whole song
|
|
|
329 |
|
330 |
directory_args = parser.add_argument_group('Directory args')
|
331 |
# directory paths
|
332 |
+
directory_args.add_argument('--target_dir', type=str, default='./yt_dir/')
|
333 |
directory_args.add_argument('--output_dir', type=str, default=None, help='if no output_dir is specified (None), the results will be saved inside the target_dir')
|
334 |
directory_args.add_argument('--input_file_name', type=str, default='input')
|
335 |
directory_args.add_argument('--reference_file_name', type=str, default='reference')
|