rahul7star commited on
Commit
13766f5
·
verified ·
1 Parent(s): 0076ef1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -29,7 +29,7 @@ print(f'Using device: {device}')
29
  MODEL = build_model('./KOKORO/kokoro-v0_19.pth', device)
30
  print("Model loaded successfully.")
31
 
32
- def tts_maker(text,voice_name="af_bella",speed = 0.8,trim=0,pad_between=0,save_path="temp.wav",remove_silence=False,minimum_silence=50):
33
  # Sanitize the save_path to remove any newline characters
34
  save_path = save_path.replace('\n', '').replace('\r', '')
35
  global MODEL
@@ -107,8 +107,8 @@ def text_to_speech(text, model_name="kokoro-v0_19.pth", voice_name="af", speed=1
107
  import gradio as gr
108
 
109
  # voice_list = [
110
- # 'af', # Default voice is a 50-50 mix of af_bella & af_sarah
111
- # 'af_bella', 'af_sarah', 'am_adam', 'am_michael',
112
  # 'bf_emma', 'bf_isabella', 'bm_george', 'bm_lewis',
113
  # ]
114
 
@@ -143,7 +143,7 @@ with gr.Blocks() as demo1:
143
  with gr.Row():
144
  voice = gr.Dropdown(
145
  voice_list,
146
- value='af_bella',
147
  allow_custom_value=False,
148
  label='Voice',
149
  info='Starred voices are more stable'
@@ -588,7 +588,7 @@ class SRTDubbing:
588
  with open("entries.json", "w") as file:
589
  json.dump(entries, file, indent=4)
590
  return entries
591
- srt_voice_name="af_bella"
592
  use_ffmpeg,local_ffmpeg_path = is_ffmpeg_installed()
593
  # use_ffmpeg=False
594
 
@@ -640,7 +640,7 @@ with gr.Blocks() as demo3:
640
  with gr.Row():
641
  voice = gr.Dropdown(
642
  voice_list,
643
- value='af_bella',
644
  allow_custom_value=False,
645
  label='Voice',
646
  )
@@ -692,12 +692,12 @@ def get_voices():
692
  if i == "af_nicole":
693
  slider_configs["af_nicole"]="Nicole 😏🇺🇸"
694
  continue
695
- if i == "af_bella":
696
- slider_configs["af_bella"]="Bella 🤗🇺🇸"
697
  continue
698
 
699
  # Determine the country emoji
700
- country = "🇺🇸" if i.startswith("a") else "🇬🇧"
701
 
702
  # Determine the gender emoji and name
703
  if "f_" in i:
 
29
  MODEL = build_model('./KOKORO/kokoro-v0_19.pth', device)
30
  print("Model loaded successfully.")
31
 
32
+ def tts_maker(text,voice_name="hf_alpha",speed = 0.8,trim=0,pad_between=0,save_path="temp.wav",remove_silence=False,minimum_silence=50):
33
  # Sanitize the save_path to remove any newline characters
34
  save_path = save_path.replace('\n', '').replace('\r', '')
35
  global MODEL
 
107
  import gradio as gr
108
 
109
  # voice_list = [
110
+ # 'af', # Default voice is a 50-50 mix of hf_alpha & af_sarah
111
+ # 'hf_alpha', 'af_sarah', 'am_adam', 'am_michael',
112
  # 'bf_emma', 'bf_isabella', 'bm_george', 'bm_lewis',
113
  # ]
114
 
 
143
  with gr.Row():
144
  voice = gr.Dropdown(
145
  voice_list,
146
+ value='hf_alpha',
147
  allow_custom_value=False,
148
  label='Voice',
149
  info='Starred voices are more stable'
 
588
  with open("entries.json", "w") as file:
589
  json.dump(entries, file, indent=4)
590
  return entries
591
+ srt_voice_name="hf_alpha"
592
  use_ffmpeg,local_ffmpeg_path = is_ffmpeg_installed()
593
  # use_ffmpeg=False
594
 
 
640
  with gr.Row():
641
  voice = gr.Dropdown(
642
  voice_list,
643
+ value='hf_alpha',
644
  allow_custom_value=False,
645
  label='Voice',
646
  )
 
692
  if i == "af_nicole":
693
  slider_configs["af_nicole"]="Nicole 😏🇺🇸"
694
  continue
695
+ if i == "hf_alpha":
696
+ slider_configs["hf_alpha"]="Hindi 🤗in"
697
  continue
698
 
699
  # Determine the country emoji
700
+ country = "🇺🇸" if i.startswith("a") else "hf"
701
 
702
  # Determine the gender emoji and name
703
  if "f_" in i: