Pendrokar commited on
Commit
181f667
Β·
1 Parent(s): fd99c78

proprietary note on Edge TTS

Browse files
Files changed (1) hide show
  1. app.py +18 -8
app.py CHANGED
@@ -175,9 +175,9 @@ HF_SPACES = {
175
  'text_param_index': 0,
176
  'return_audio_index': 0,
177
  },
178
- # Parler, using Expresso dataset
179
  'parler-tts/parler-tts-expresso': {
180
- 'name': 'Parler Expresso',
181
  'function': '/gen_tts',
182
  'text_param_index': 0,
183
  'return_audio_index': 0,
@@ -189,6 +189,7 @@ HF_SPACES = {
189
  'function': '/predict',
190
  'text_param_index': 0,
191
  'return_audio_index': 0,
 
192
  },
193
 
194
  'fishaudio/fish-speech-1': {
@@ -639,7 +640,7 @@ def get_leaderboard(reveal_prelim = False):
639
  # df['license'] = df['name'].map(model_license)
640
  df['name'] = df['name'].replace(model_names)
641
  for i in range(len(df)):
642
- df.loc[i, "name"] = make_link_to_space(df['name'][i])
643
  df['votes'] = df['upvote'] + df['downvote']
644
  # df['score'] = round((df['upvote'] / df['votes']) * 100, 2) # Percentage score
645
 
@@ -674,36 +675,45 @@ def get_leaderboard(reveal_prelim = False):
674
  df = df[['order', 'name', 'score', 'votes']]
675
  return df
676
 
677
- def make_link_to_space(model_name):
678
  # create a anchor link if a HF space
679
  style = 'text-decoration: underline;text-decoration-style: dotted;'
680
  title = ''
681
 
682
- # bolden actual name
683
- # model_name_split = model_name.split('/')
684
- # model_name_split = model_name_split[:-1].join('/') +'/<strong>'+ model_name_split[-1] +'</strong>'
685
  if model_name in AVAILABLE_MODELS:
686
  style += 'color: var(--link-text-color);'
687
  title = model_name
688
  else:
689
  style += 'font-style: italic;'
690
- title = 'Got disabled for Arena (See AVAILABLE_MODELS within code for why)'
691
 
692
  model_basename = model_name
693
  if model_name in HF_SPACES:
694
  model_basename = HF_SPACES[model_name]['name']
695
 
 
 
 
 
 
 
 
 
 
 
696
  if '/' in model_name:
697
  return 'πŸ€— <a target="_blank" style="'+ style +'" title="'+ title +'" href="'+ 'https://huggingface.co/spaces/'+ model_name +'">'+ model_basename +'</a>'
698
 
699
  # otherwise just return the model name
700
  return model_name
 
701
  def markdown_link_to_space(model_name):
702
  # create a anchor link if a HF space using markdown syntax
703
  if '/' in model_name:
704
  return 'πŸ€— [' + model_name + '](https://huggingface.co/spaces/' + model_name + ')'
705
  # otherwise just return the model name
706
  return model_name
 
707
  def mkuuid(uid):
708
  if not uid:
709
  uid = uuid.uuid4()
 
175
  'text_param_index': 0,
176
  'return_audio_index': 0,
177
  },
178
+ # Parler Mini, using Expresso dataset
179
  'parler-tts/parler-tts-expresso': {
180
+ 'name': 'Parler Mini Expresso',
181
  'function': '/gen_tts',
182
  'text_param_index': 0,
183
  'return_audio_index': 0,
 
189
  'function': '/predict',
190
  'text_param_index': 0,
191
  'return_audio_index': 0,
192
+ 'is_proprietary': True,
193
  },
194
 
195
  'fishaudio/fish-speech-1': {
 
640
  # df['license'] = df['name'].map(model_license)
641
  df['name'] = df['name'].replace(model_names)
642
  for i in range(len(df)):
643
+ df.loc[i, "name"] = make_link_to_space(df['name'][i], True)
644
  df['votes'] = df['upvote'] + df['downvote']
645
  # df['score'] = round((df['upvote'] / df['votes']) * 100, 2) # Percentage score
646
 
 
675
  df = df[['order', 'name', 'score', 'votes']]
676
  return df
677
 
678
+ def make_link_to_space(model_name, for_leaderboard=False):
679
  # create a anchor link if a HF space
680
  style = 'text-decoration: underline;text-decoration-style: dotted;'
681
  title = ''
682
 
 
 
 
683
  if model_name in AVAILABLE_MODELS:
684
  style += 'color: var(--link-text-color);'
685
  title = model_name
686
  else:
687
  style += 'font-style: italic;'
688
+ title = 'Disabled for Arena (See AVAILABLE_MODELS within code for why)'
689
 
690
  model_basename = model_name
691
  if model_name in HF_SPACES:
692
  model_basename = HF_SPACES[model_name]['name']
693
 
694
+ try:
695
+ if(
696
+ for_leaderboard
697
+ and HF_SPACES[model_name]['is_proprietary']
698
+ ):
699
+ model_basename += ' πŸ”'
700
+ title += '; πŸ” = online only or proprietary'
701
+ except:
702
+ pass
703
+
704
  if '/' in model_name:
705
  return 'πŸ€— <a target="_blank" style="'+ style +'" title="'+ title +'" href="'+ 'https://huggingface.co/spaces/'+ model_name +'">'+ model_basename +'</a>'
706
 
707
  # otherwise just return the model name
708
  return model_name
709
+
710
  def markdown_link_to_space(model_name):
711
  # create a anchor link if a HF space using markdown syntax
712
  if '/' in model_name:
713
  return 'πŸ€— [' + model_name + '](https://huggingface.co/spaces/' + model_name + ')'
714
  # otherwise just return the model name
715
  return model_name
716
+
717
  def mkuuid(uid):
718
  if not uid:
719
  uid = uuid.uuid4()