Pendrokar commited on
Commit
2d0cccd
β€’
2 Parent(s): b2154bf 0c995d0

Merge remote-tracking branch 'origin/main' into spaces

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +7 -1
README.md CHANGED
@@ -4,7 +4,7 @@ sdk: gradio
4
  app_file: app.py
5
  license: zlib
6
  tags:
7
- - leaderboard
8
  emoji: πŸ€—πŸ†
9
  colorFrom: red
10
  colorTo: red
 
4
  app_file: app.py
5
  license: zlib
6
  tags:
7
+ - arena
8
  emoji: πŸ€—πŸ†
9
  colorFrom: red
10
  colorTo: red
app.py CHANGED
@@ -37,6 +37,8 @@ AVAILABLE_MODELS = {
37
  # 'OpenVoice': 'openvoice',
38
  # 'Pheme': 'pheme',
39
  # 'MetaVoice': 'metavoice'
 
 
40
 
41
  # '<Space>': <function>#<return-index-of-audio-param>
42
  'coqui/xtts': '1#1',
@@ -625,7 +627,11 @@ def synthandreturn(text):
625
  raise gr.Error(f'You exceeded the limit of {MAX_SAMPLE_TXT_LENGTH} characters')
626
  if len(text) < MIN_SAMPLE_TXT_LENGTH:
627
  raise gr.Error(f'Please input a text longer than {MIN_SAMPLE_TXT_LENGTH} characters')
628
- if (toxicity.predict(text)['toxicity'] > 0.8):
 
 
 
 
629
  print(f'Detected toxic content! "{text}"')
630
  raise gr.Error('Your text failed the toxicity test')
631
  if not text:
 
37
  # 'OpenVoice': 'openvoice',
38
  # 'Pheme': 'pheme',
39
  # 'MetaVoice': 'metavoice'
40
+ # 'MeloTTS': 'melo',
41
+ # 'StyleTTS 2': 'styletts2',
42
 
43
  # '<Space>': <function>#<return-index-of-audio-param>
44
  'coqui/xtts': '1#1',
 
627
  raise gr.Error(f'You exceeded the limit of {MAX_SAMPLE_TXT_LENGTH} characters')
628
  if len(text) < MIN_SAMPLE_TXT_LENGTH:
629
  raise gr.Error(f'Please input a text longer than {MIN_SAMPLE_TXT_LENGTH} characters')
630
+ if (
631
+ # test toxicity if not prepared text
632
+ text not in sents
633
+ and toxicity.predict(text)['toxicity'] > 0.8
634
+ ):
635
  print(f'Detected toxic content! "{text}"')
636
  raise gr.Error('Your text failed the toxicity test')
637
  if not text: