smjain commited on
Commit
964b339
1 Parent(s): eb7e3d6

Upload myinfer_latest.py

Browse files
Files changed (1) hide show
  1. myinfer_latest.py +10 -4
myinfer_latest.py CHANGED
@@ -196,11 +196,17 @@ def api_convert_voice():
196
  # Wait for the process to finish and get the result
197
  p.join()
198
  print("*******waiting for process to complete ")
199
- output_path = output_queue.get()
200
- if isinstance(output_path, Exception):
201
- print("Exception in worker:", output_path)
202
- else:
203
  print("output path of converted voice", output_path)
 
 
 
 
 
 
 
 
204
  #output_path = convert_voice(spk_id, vocal_path, voice_transform,unique_id)
205
  output_path1= combine_vocal_and_inst(output_path,inst,unique_id)
206
 
 
196
  # Wait for the process to finish and get the result
197
  p.join()
198
  print("*******waiting for process to complete ")
199
+ try:
200
+ output_path = output_queue.get(timeout=10) # Wait for 10 seconds
 
 
201
  print("output path of converted voice", output_path)
202
+ except queue.Empty:
203
+ print("Queue was empty or worker did not complete in time")
204
+
205
+ #output_path = output_queue.get()
206
+ #if isinstance(output_path, Exception):
207
+ # print("Exception in worker:", output_path)
208
+ #else:
209
+ # print("output path of converted voice", output_path)
210
  #output_path = convert_voice(spk_id, vocal_path, voice_transform,unique_id)
211
  output_path1= combine_vocal_and_inst(output_path,inst,unique_id)
212