gholapeajinkya commited on
Commit
246aaea
·
verified ·
1 Parent(s): bfcc2bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -270,8 +270,7 @@ def list_all_nested_contents(base_path):
270
 
271
  def voice_cloning(segments, audio_path, max_threads=2):
272
  audio = AudioSegment.from_file(audio_path)
273
- with st.spinner("🤖 Cloning voice..."):
274
- print("[Voice Cloning] - Initiated", flush=True)
275
  for segment in segments:
276
  start_ms = int(segment["start"] * 1000)
277
  end_ms = int(segment["end"] * 1000)
@@ -280,7 +279,9 @@ def voice_cloning(segments, audio_path, max_threads=2):
280
  f"cropped_{segment['id']}.wav"), format="wav")
281
  print(f"cropped_{segment['id']}.wav", flush=True)
282
  list_all_nested_contents("/tmp")
 
283
  try:
 
284
  # with ThreadPoolExecutor(max_workers=max_threads) as executor:
285
  # print("[Voice Cloning] - Thread Initiated", flush=True)
286
  # futures = []
@@ -302,7 +303,7 @@ def voice_cloning(segments, audio_path, max_threads=2):
302
  # futures.append(future)
303
  # for future in as_completed(futures):
304
  # output = future.result()
305
- print(f"F5 TTS Infer output: {output}", flush=True)
306
  print("[Done] Cloning voice", flush=True)
307
  except Exception as e:
308
  print(f"Voice cloning failed: {e}")
 
270
 
271
  def voice_cloning(segments, audio_path, max_threads=2):
272
  audio = AudioSegment.from_file(audio_path)
273
+ with st.spinner("🔊 Cropping audio segments..."):
 
274
  for segment in segments:
275
  start_ms = int(segment["start"] * 1000)
276
  end_ms = int(segment["end"] * 1000)
 
279
  f"cropped_{segment['id']}.wav"), format="wav")
280
  print(f"cropped_{segment['id']}.wav", flush=True)
281
  list_all_nested_contents("/tmp")
282
+ with st.spinner("🤖 Cloning voice..."):
283
  try:
284
+ print("[Voice Cloning] - Initiated", flush=True)
285
  # with ThreadPoolExecutor(max_workers=max_threads) as executor:
286
  # print("[Voice Cloning] - Thread Initiated", flush=True)
287
  # futures = []
 
303
  # futures.append(future)
304
  # for future in as_completed(futures):
305
  # output = future.result()
306
+ # print(f"F5 TTS Infer output: {output}", flush=True)
307
  print("[Done] Cloning voice", flush=True)
308
  except Exception as e:
309
  print(f"Voice cloning failed: {e}")