JymNils commited on
Commit
2772573
·
verified ·
1 Parent(s): 555d90e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -32
app.py CHANGED
@@ -14,9 +14,7 @@ if not IS_DUPLICATE:
14
 
15
  CHAR_LIMIT = None if IS_DUPLICATE else 5000
16
  models = {gpu: KModel().to('cuda' if gpu else 'cpu').eval() for gpu in [False] + ([True] if CUDA_AVAILABLE else [])}
17
- pipelines = {lang_code: KPipeline(lang_code=lang_code, model=False) for lang_code in 'ab'}
18
- pipelines['a'].g2p.lexicon.golds['kokoro'] = 'kˈOkəɹO'
19
- pipelines['b'].g2p.lexicon.golds['kokoro'] = 'kˈQkəɹQ'
20
 
21
  @spaces.GPU(duration=30)
22
  def forward_gpu(ps, ref_s, speed):
@@ -94,37 +92,14 @@ def get_frankenstein():
94
  return r.read().strip()
95
 
96
  CHOICES = {
97
- '🇺🇸 🚺 Heart ❤️': 'af_heart',
98
- '🇺🇸 🚺 Bella 🔥': 'af_bella',
99
- '🇺🇸 🚺 Nicole 🎧': 'af_nicole',
100
- '🇺🇸 🚺 Aoede': 'af_aoede',
101
- '🇺🇸 🚺 Kore': 'af_kore',
102
- '🇺🇸 🚺 Sarah': 'af_sarah',
103
- '🇺🇸 🚺 Nova': 'af_nova',
104
- '🇺🇸 🚺 Sky': 'af_sky',
105
- '🇺🇸 🚺 Alloy': 'af_alloy',
106
- '🇺🇸 🚺 Jessica': 'af_jessica',
107
- '🇺🇸 🚺 River': 'af_river',
108
- '🇺🇸 🚹 Michael': 'am_michael',
109
- '🇺🇸 🚹 Fenrir': 'am_fenrir',
110
- '🇺🇸 🚹 Puck': 'am_puck',
111
- '🇺🇸 🚹 Echo': 'am_echo',
112
- '🇺🇸 🚹 Eric': 'am_eric',
113
- '🇺🇸 🚹 Liam': 'am_liam',
114
- '🇺🇸 🚹 Onyx': 'am_onyx',
115
- '🇺🇸 🚹 Santa': 'am_santa',
116
- '🇺🇸 🚹 Adam': 'am_adam',
117
- '🇬🇧 🚺 Emma': 'bf_emma',
118
- '🇬🇧 🚺 Isabella': 'bf_isabella',
119
- '🇬🇧 🚺 Alice': 'bf_alice',
120
- '🇬🇧 🚺 Lily': 'bf_lily',
121
- '🇬🇧 🚹 George': 'bm_george',
122
- '🇬🇧 🚹 Fable': 'bm_fable',
123
- '🇬🇧 🚹 Lewis': 'bm_lewis',
124
- '🇬🇧 🚹 Daniel': 'bm_daniel',
125
  }
126
  for v in CHOICES.values():
127
- pipelines[v[0]].load_voice(v)
 
 
128
 
129
  TOKEN_NOTE = '''
130
  💡 Customize pronunciation with Markdown link syntax and /slashes/ like `[Kokoro](/kˈOkəɹO/)`
 
14
 
15
  CHAR_LIMIT = None if IS_DUPLICATE else 5000
16
  models = {gpu: KModel().to('cuda' if gpu else 'cpu').eval() for gpu in [False] + ([True] if CUDA_AVAILABLE else [])}
17
+ pipelines = {lang_code: KPipeline(lang_code=lang_code, model=False) for lang_code in 'e'}
 
 
18
 
19
  @spaces.GPU(duration=30)
20
  def forward_gpu(ps, ref_s, speed):
 
92
  return r.read().strip()
93
 
94
  CHOICES = {
95
+ '🇪🇸 🚺 Dora': 'ef_dora',
96
+ '🇪🇸 🚹 Alex': 'em_alex',
97
+ '🇪🇸 🚹 Santa': 'em_santa',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
  for v in CHOICES.values():
100
+ lang_code = v[0]
101
+ if lang_code in pipelines:
102
+ pipelines[lang_code].load_voice(v)
103
 
104
  TOKEN_NOTE = '''
105
  💡 Customize pronunciation with Markdown link syntax and /slashes/ like `[Kokoro](/kˈOkəɹO/)`