Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files196 unmodified lines19719819920020120220335 unmodified lines239240241242243244245246247248249250251252196 unmodified linesp.join()print("*******waiting for process to complete ")output_path = output_queue.get()print("output path of converted voice",output_path)#output_path = convert_voice(spk_id, vocal_path, voice_transform,unique_id)output_path1= combine_vocal_and_inst(output_path,inst,unique_id)35 unmodified linesreturn jsonify({"error": "File not found."}), 404def worker(spk_id, input_audio_path, voice_transform, unique_id, output_queue):"""Worker function to be executed in a separate process."""# Call the convert_voice functionoutput_audio_path = convert_voice(spk_id, input_audio_path, voice_transform, unique_id)print("output in worker for audio file",output_audio_path)# Put the result in the queue to be retrieved by the main processoutput_queue.put(output_audio_path)def convert_voice(spk_id, input_audio_path, voice_transform,unique_id):get_vc(spk_id,0.5)print("*****before makinf call to vc ", unique_id)196 unmodified lines19719819920020120220320420520635 unmodified lines242243244245246247248249250251252253254196 unmodified linesp.join()print("*******waiting for process to complete ")output_path = output_queue.get()if isinstance(output_path, Exception):print("Exception in worker:", output_path)else:print("output path of converted voice", output_path)#output_path = convert_voice(spk_id, vocal_path, voice_transform,unique_id)output_path1= combine_vocal_and_inst(output_path,inst,unique_id)35 unmodified linesreturn jsonify({"error": "File not found."}), 404def worker(spk_id, input_audio_path, voice_transform, unique_id, output_queue):try:output_audio_path = convert_voice(spk_id, input_audio_path, voice_transform, unique_id)print("output in worker for audio file", output_audio_path)output_queue.put(output_audio_path)except Exception as e:output_queue.put(e) # Send the exception to the main process for debuggingdef convert_voice(spk_id, input_audio_path, voice_transform,unique_id):get_vc(spk_id,0.5)print("*****before makinf call to vc ", unique_id)
myinfer_latest.py+11-9