mrfakename commited on
Commit
375d701
β€’
1 Parent(s): 7b611ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -139,12 +139,22 @@ DESCR = """
139
 
140
  Vote on different speech synthesis models!
141
  """.strip()
 
 
 
 
 
 
 
 
 
142
  INSTR = """
143
  ## Instructions
144
 
145
- * Listen to two anonymous models
 
146
  * Vote on which synthesized audio sounds more natural to you
147
- * If there's a tie, click Skip
148
 
149
  **When you're ready to begin, login and begin voting!** The model names will be revealed once you vote.
150
  """.strip()
@@ -180,7 +190,7 @@ We may store text you enter and generated audio. We store a unique ID for each s
180
 
181
  ### License
182
 
183
- Please assume all audio clips are not licensed to be redistributed and may only be used for personal, non-commercial use.
184
  """.strip()
185
  LDESC = """
186
  ## Leaderboard
@@ -206,7 +216,6 @@ def del_db(txt):
206
 
207
  # Recreate
208
  create_db_if_missing()
209
- gr.Error('You probably want to restart the space now')
210
  return 'Delete DB'
211
 
212
  theme = gr.themes.Base(
@@ -422,6 +431,8 @@ def synthandreturn(text):
422
  text = text.strip()
423
  if len(text) > MAX_SAMPLE_TXT_LENGTH:
424
  raise gr.Error(f'You exceeded the limit of {MAX_SAMPLE_TXT_LENGTH} characters')
 
 
425
  # Get two random models
426
  mdl1, mdl2 = random.sample(AVAILABLE_MODELS.keys(), 2)
427
  return (
@@ -497,7 +508,7 @@ with gr.Blocks(theme=theme, css="footer {visibility: hidden}textbox{resize:none}
497
  gr.TabbedInterface([vote, leaderboard, about, admin], ['Vote', 'Leaderboard', 'About', 'Admin (ONLY IN BETA)'])
498
  if CITATION_TEXT:
499
  with gr.Row():
500
- with gr.Accordion("Citation", open=False):
501
  gr.Markdown(f"If you use this data in your publication, please cite us!\n\nCopy the BibTeX citation to cite this source:\n\n```bibtext\n{CITATION_TEXT}\n```")
502
 
503
 
 
139
 
140
  Vote on different speech synthesis models!
141
  """.strip()
142
+ # INSTR = """
143
+ # ## Instructions
144
+
145
+ # * Listen to two anonymous models
146
+ # * Vote on which synthesized audio sounds more natural to you
147
+ # * If there's a tie, click Skip
148
+
149
+ # **When you're ready to begin, login and begin voting!** The model names will be revealed once you vote.
150
+ # """.strip()
151
  INSTR = """
152
  ## Instructions
153
 
154
+ * Enter text to synthesize
155
+ * Listen to the two audio clips
156
  * Vote on which synthesized audio sounds more natural to you
157
+ * Repeat!
158
 
159
  **When you're ready to begin, login and begin voting!** The model names will be revealed once you vote.
160
  """.strip()
 
190
 
191
  ### License
192
 
193
+ Please assume all generated audio clips are not licensed to be redistributed and may only be used for personal, non-commercial use.
194
  """.strip()
195
  LDESC = """
196
  ## Leaderboard
 
216
 
217
  # Recreate
218
  create_db_if_missing()
 
219
  return 'Delete DB'
220
 
221
  theme = gr.themes.Base(
 
431
  text = text.strip()
432
  if len(text) > MAX_SAMPLE_TXT_LENGTH:
433
  raise gr.Error(f'You exceeded the limit of {MAX_SAMPLE_TXT_LENGTH} characters')
434
+ if not text:
435
+ raise gr.Error(f'You did not enter any text')
436
  # Get two random models
437
  mdl1, mdl2 = random.sample(AVAILABLE_MODELS.keys(), 2)
438
  return (
 
508
  gr.TabbedInterface([vote, leaderboard, about, admin], ['Vote', 'Leaderboard', 'About', 'Admin (ONLY IN BETA)'])
509
  if CITATION_TEXT:
510
  with gr.Row():
511
+ with gr.Accordion("πŸ“™ Citation", open=False):
512
  gr.Markdown(f"If you use this data in your publication, please cite us!\n\nCopy the BibTeX citation to cite this source:\n\n```bibtext\n{CITATION_TEXT}\n```")
513
 
514