Pendrokar commited on
Commit
d6e6719
Β·
1 Parent(s): c213824

HF custom emojis for disabled spaces

Browse files
Files changed (1) hide show
  1. app/models.py +16 -3
app/models.py CHANGED
@@ -87,6 +87,7 @@ HF_SPACES = {
87
  'text_param_index': 0,
88
  'return_audio_index': 0,
89
  'series': 'WhisperSpeech',
 
90
  },
91
  # OpenVoice (MyShell.ai)
92
  'myshell-ai/OpenVoice': {
@@ -111,6 +112,7 @@ HF_SPACES = {
111
  'text_param_index': 0,
112
  'return_audio_index': 0,
113
  'series': 'MetaVoice-1B',
 
114
  },
115
  # xVASynth (CPU)
116
  'Pendrokar/xVASynth-TTS': {
@@ -135,6 +137,7 @@ HF_SPACES = {
135
  'text_param_index': 0,
136
  'return_audio_index': 0,
137
  'series': 'HierSpeech++',
 
138
  },
139
  # MeloTTS (MyShell.ai)
140
  'mrfakename/MeloTTS': {
@@ -171,6 +174,7 @@ HF_SPACES = {
171
  'return_audio_index': 0,
172
  'is_zero_gpu_space': True,
173
  'series': 'Parler',
 
174
  },
175
 
176
  # Microsoft Edge TTS
@@ -181,6 +185,7 @@ HF_SPACES = {
181
  'return_audio_index': 0,
182
  'is_closed_source': True,
183
  'series': 'Edge TTS',
 
184
  },
185
 
186
  # Fish Speech
@@ -218,6 +223,7 @@ HF_SPACES = {
218
  'text_param_index': 0,
219
  'return_audio_index': 0,
220
  'series': 'IMS-Toucan',
 
221
  },
222
 
223
  # StyleTTS v2
@@ -228,6 +234,7 @@ HF_SPACES = {
228
  'return_audio_index': 0,
229
  'is_zero_gpu_space': True,
230
  'series': 'StyleTTS',
 
231
  },
232
 
233
  # StyleTTS v2 kokoro fine tune
@@ -248,6 +255,7 @@ HF_SPACES = {
248
  'return_audio_index': 0,
249
  'is_zero_gpu_space': True,
250
  'series': 'MaskGCT',
 
251
  },
252
  'Svngoku/maskgct-audio-lab': {
253
  'name': 'MaskGCT',
@@ -256,6 +264,7 @@ HF_SPACES = {
256
  'return_audio_index': 0,
257
  'is_zero_gpu_space': True,
258
  'series': 'MaskGCT',
 
259
  },
260
  }
261
 
@@ -436,10 +445,9 @@ def make_link_to_space(model_name, for_leaderboard=False):
436
 
437
  if model_name in AVAILABLE_MODELS:
438
  style += 'color: var(--link-text-color);'
439
- title = model_name
440
  else:
441
  style += 'font-style: italic;'
442
- title = 'Disabled for Arena (See AVAILABLE_MODELS within code for why)'
443
 
444
  model_basename = model_name
445
  if model_name in HF_SPACES:
@@ -456,7 +464,12 @@ def make_link_to_space(model_name, for_leaderboard=False):
456
  pass
457
 
458
  if '/' in model_name:
459
- return 'πŸ€— <a target="_blank" style="'+ style +'" title="'+ title +'" href="'+ 'https://huggingface.co/spaces/'+ model_name +'">'+ model_basename +'</a>'
 
 
 
 
 
460
 
461
  # otherwise just return the model name
462
  return '<span style="'+ style +'" title="'+ title +'" href="'+ 'https://huggingface.co/spaces/'+ model_name +'">'+ model_name +'</span>'
 
87
  'text_param_index': 0,
88
  'return_audio_index': 0,
89
  'series': 'WhisperSpeech',
90
+ 'emoji': '😷', # broken space
91
  },
92
  # OpenVoice (MyShell.ai)
93
  'myshell-ai/OpenVoice': {
 
112
  'text_param_index': 0,
113
  'return_audio_index': 0,
114
  'series': 'MetaVoice-1B',
115
+ 'emoji': '😷', # broken space
116
  },
117
  # xVASynth (CPU)
118
  'Pendrokar/xVASynth-TTS': {
 
137
  'text_param_index': 0,
138
  'return_audio_index': 0,
139
  'series': 'HierSpeech++',
140
+ 'emoji': 'πŸ˜’', # unemotional
141
  },
142
  # MeloTTS (MyShell.ai)
143
  'mrfakename/MeloTTS': {
 
174
  'return_audio_index': 0,
175
  'is_zero_gpu_space': True,
176
  'series': 'Parler',
177
+ 'emoji': 'πŸ˜ƒ', # overlly jolly voice
178
  },
179
 
180
  # Microsoft Edge TTS
 
185
  'return_audio_index': 0,
186
  'is_closed_source': True,
187
  'series': 'Edge TTS',
188
+ 'emoji': 'πŸ˜‘', # api disabled
189
  },
190
 
191
  # Fish Speech
 
223
  'text_param_index': 0,
224
  'return_audio_index': 0,
225
  'series': 'IMS-Toucan',
226
+ 'emoji': 'πŸ˜’', # unemotional
227
  },
228
 
229
  # StyleTTS v2
 
234
  'return_audio_index': 0,
235
  'is_zero_gpu_space': True,
236
  'series': 'StyleTTS',
237
+ 'emoji': 'πŸ˜ͺ',
238
  },
239
 
240
  # StyleTTS v2 kokoro fine tune
 
255
  'return_audio_index': 0,
256
  'is_zero_gpu_space': True,
257
  'series': 'MaskGCT',
258
+ 'emoji': 'πŸ₯΅', # 300s minimum ZeroGPU!
259
  },
260
  'Svngoku/maskgct-audio-lab': {
261
  'name': 'MaskGCT',
 
264
  'return_audio_index': 0,
265
  'is_zero_gpu_space': True,
266
  'series': 'MaskGCT',
267
+ 'emoji': 'πŸ₯΅', # 300s minimum ZeroGPU!
268
  },
269
  }
270
 
 
445
 
446
  if model_name in AVAILABLE_MODELS:
447
  style += 'color: var(--link-text-color);'
 
448
  else:
449
  style += 'font-style: italic;'
450
+ title += model_name +'; Disabled (See AVAILABLE_MODELS within code for why)'
451
 
452
  model_basename = model_name
453
  if model_name in HF_SPACES:
 
464
  pass
465
 
466
  if '/' in model_name:
467
+ emoji = 'πŸ€—' # HF
468
+ try:
469
+ emoji = HF_SPACES[model_name]['emoji']
470
+ except:
471
+ pass
472
+ return emoji +' <a target="_blank" style="'+ style +'" title="'+ title +'" href="'+ 'https://huggingface.co/spaces/'+ model_name +'">'+ model_basename +'</a>'
473
 
474
  # otherwise just return the model name
475
  return '<span style="'+ style +'" title="'+ title +'" href="'+ 'https://huggingface.co/spaces/'+ model_name +'">'+ model_name +'</span>'