Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files- myinfer_latest.py +3 -2
myinfer_latest.py
CHANGED
@@ -26,7 +26,7 @@ import uuid
|
|
26 |
from threading import Semaphore
|
27 |
from threading import Lock
|
28 |
from multiprocessing import Process, Queue, set_start_method,get_context
|
29 |
-
|
30 |
|
31 |
|
32 |
|
@@ -199,7 +199,7 @@ def api_convert_voice():
|
|
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
|
203 |
print("Queue was empty or worker did not complete in time")
|
204 |
|
205 |
#output_path = output_queue.get()
|
@@ -252,6 +252,7 @@ def worker(spk_id, input_audio_path, voice_transform, unique_id, output_queue):
|
|
252 |
output_audio_path = convert_voice(spk_id, input_audio_path, voice_transform, unique_id)
|
253 |
print("output in worker for audio file", output_audio_path)
|
254 |
output_queue.put(output_audio_path)
|
|
|
255 |
except Exception as e:
|
256 |
output_queue.put(e) # Send the exception to the main process for debugging
|
257 |
|
|
|
26 |
from threading import Semaphore
|
27 |
from threading import Lock
|
28 |
from multiprocessing import Process, Queue, set_start_method,get_context
|
29 |
+
from queue import Empty
|
30 |
|
31 |
|
32 |
|
|
|
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 Empty:
|
203 |
print("Queue was empty or worker did not complete in time")
|
204 |
|
205 |
#output_path = output_queue.get()
|
|
|
252 |
output_audio_path = convert_voice(spk_id, input_audio_path, voice_transform, unique_id)
|
253 |
print("output in worker for audio file", output_audio_path)
|
254 |
output_queue.put(output_audio_path)
|
255 |
+
print("added to output queue")
|
256 |
except Exception as e:
|
257 |
output_queue.put(e) # Send the exception to the main process for debugging
|
258 |
|