smjain commited on
Commit
611fa7e
1 Parent(s): 1098c94

Upload myinfer_latest.py

Browse files
Files changed (1) hide show
  1. myinfer_latest.py +3 -3
myinfer_latest.py CHANGED
@@ -25,7 +25,7 @@ from pydub import AudioSegment
25
  import uuid
26
  from threading import Semaphore
27
  from threading import Lock
28
- from multiprocessing import Process, Queue, set_start_method
29
 
30
 
31
 
@@ -47,7 +47,7 @@ MAX_CONCURRENT_REQUESTS = 2 # Adjust this number as needed
47
  # Initialize the semaphore with the maximum number of concurrent requests
48
  request_semaphore = Semaphore(MAX_CONCURRENT_REQUESTS)
49
 
50
- set_start_method('spawn', force=True)
51
  from lib.infer_pack.models import (
52
  SynthesizerTrnMs256NSFsid,
53
  SynthesizerTrnMs256NSFsid_nono,
@@ -188,7 +188,7 @@ def api_convert_voice():
188
  inst = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"
189
  print("*****before making call to convert ", unique_id)
190
  output_queue = Queue()
191
-
192
  # Create and start the process
193
  p = Process(target=worker, args=(spk_id, vocal_path, voice_transform, unique_id, output_queue))
194
  p.start()
 
25
  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
 
 
47
  # Initialize the semaphore with the maximum number of concurrent requests
48
  request_semaphore = Semaphore(MAX_CONCURRENT_REQUESTS)
49
 
50
+ #set_start_method('spawn', force=True)
51
  from lib.infer_pack.models import (
52
  SynthesizerTrnMs256NSFsid,
53
  SynthesizerTrnMs256NSFsid_nono,
 
188
  inst = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"
189
  print("*****before making call to convert ", unique_id)
190
  output_queue = Queue()
191
+ ctx = get_context('spawn')
192
  # Create and start the process
193
  p = Process(target=worker, args=(spk_id, vocal_path, voice_transform, unique_id, output_queue))
194
  p.start()