mrfakename commited on
Commit
72d3fba
1 Parent(s): 0053ffc

add admin beta

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -48,6 +48,9 @@ A list of the models, based on how highly they are ranked!
48
 
49
 
50
  dataset = load_dataset("ttseval/tts-arena-new", token=os.getenv('HF_TOKEN'))
 
 
 
51
  theme = gr.themes.Base(
52
  font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
53
  )
@@ -231,10 +234,12 @@ with gr.Blocks() as vote:
231
  vote.load(reload, outputs=[aud1, aud2, model1, model2])
232
  with gr.Blocks() as about:
233
  gr.Markdown(ABOUT)
234
- pass
 
 
235
  with gr.Blocks(theme=theme, css="footer {visibility: hidden}", title="TTS Leaderboard") as demo:
236
  gr.Markdown(DESCR)
237
- gr.TabbedInterface([vote, leaderboard, about], ['Vote', 'Leaderboard', 'About'])
238
  def restart_space():
239
  api = HfApi(
240
  token=os.getenv('HF_TOKEN')
 
48
 
49
 
50
  dataset = load_dataset("ttseval/tts-arena-new", token=os.getenv('HF_TOKEN'))
51
+ def reload_db():
52
+ global dataset
53
+ dataset = load_dataset("ttseval/tts-arena-new", token=os.getenv('HF_TOKEN'))
54
  theme = gr.themes.Base(
55
  font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
56
  )
 
234
  vote.load(reload, outputs=[aud1, aud2, model1, model2])
235
  with gr.Blocks() as about:
236
  gr.Markdown(ABOUT)
237
+ with gr.Blocks() as admin:
238
+ rdb = gr.Button("Reload dataset")
239
+ rdb.click(reload_db)
240
  with gr.Blocks(theme=theme, css="footer {visibility: hidden}", title="TTS Leaderboard") as demo:
241
  gr.Markdown(DESCR)
242
+ gr.TabbedInterface([vote, leaderboard, about, admin], ['Vote', 'Leaderboard', 'About', 'Admin (ONLY IN BETA)'])
243
  def restart_space():
244
  api = HfApi(
245
  token=os.getenv('HF_TOKEN')