Pendrokar commited on
Commit
ed360bb
·
1 Parent(s): 54bc519

running locally

Browse files
Files changed (3) hide show
  1. README.md +14 -0
  2. app/config.py +12 -2
  3. app/ui.py +3 -0
README.md CHANGED
@@ -33,3 +33,17 @@ sdk_version: 5.4.0
33
 
34
  [Saved votes dataset](https://huggingface.co/datasets/Pendrokar/TTS_Arena)
35
  [TTS tracker dataset](https://huggingface.co/datasets/Pendrokar/open_tts_tracker)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  [Saved votes dataset](https://huggingface.co/datasets/Pendrokar/TTS_Arena)
35
  [TTS tracker dataset](https://huggingface.co/datasets/Pendrokar/open_tts_tracker)
36
+
37
+ # TTS Arena
38
+
39
+ The codebase for TTS Arena v2.
40
+
41
+ The TTS Arena is a Gradio app with several components. Please refer to the `app` directory for more information.
42
+
43
+ ## Running the app
44
+
45
+ ```bash
46
+ RUNNING_LOCALLY=1 python app.py
47
+ ```
48
+
49
+ You must set the `RUNNING_LOCALLY` environment variable to `1` when running the app locally. This prevents it from syncing with the database
app/config.py CHANGED
@@ -1,5 +1,11 @@
1
  import os
2
 
 
 
 
 
 
 
3
  # NOTE: Configure models in `models.py`
4
 
5
  #########################
@@ -18,7 +24,7 @@ DB_PATH = f"/data/{DB_NAME}" if os.path.isdir("/data") else DB_NAME # If /data a
18
  ROUTER_ID = "Pendrokar/xVASynth-TTS" # You should use a router space to route TTS models to avoid exposing your API keys!
19
  # ROUTER_ID = "TTS-AGI/tts-router" # You should use a router space to route TTS models to avoid exposing your API keys!
20
 
21
- SYNC_DB = True # Sync DB to HF dataset?
22
  DB_DATASET_ID = os.getenv('DATASET_ID') # HF dataset ID, can be None if not syncing
23
 
24
  SPACE_ID = os.getenv('SPACE_ID') # Don't change this! It detects if we're running in a HF Space
@@ -48,4 +54,8 @@ CITATION_TEXT = """@misc{tts-arena,
48
  year = 2024,
49
  publisher = {Hugging Face},
50
  howpublished = "\\url{https://huggingface.co/spaces/TTS-AGI/TTS-Arena}"
51
- }"""
 
 
 
 
 
1
  import os
2
 
3
+ RUNNING_LOCALLY = os.getenv('RUNNING_LOCALLY', '0').lower() in ('true', '1', 't')
4
+ if RUNNING_LOCALLY:
5
+ print("Running locally, not syncing DB to HF dataset")
6
+ else:
7
+ print("Running in HF Space, syncing DB to HF dataset")
8
+
9
  # NOTE: Configure models in `models.py`
10
 
11
  #########################
 
24
  ROUTER_ID = "Pendrokar/xVASynth-TTS" # You should use a router space to route TTS models to avoid exposing your API keys!
25
  # ROUTER_ID = "TTS-AGI/tts-router" # You should use a router space to route TTS models to avoid exposing your API keys!
26
 
27
+ SYNC_DB = not RUNNING_LOCALLY # Sync DB to HF dataset?
28
  DB_DATASET_ID = os.getenv('DATASET_ID') # HF dataset ID, can be None if not syncing
29
 
30
  SPACE_ID = os.getenv('SPACE_ID') # Don't change this! It detects if we're running in a HF Space
 
54
  year = 2024,
55
  publisher = {Hugging Face},
56
  howpublished = "\\url{https://huggingface.co/spaces/TTS-AGI/TTS-Arena}"
57
+ }"""
58
+
59
+ #- 2025/01/21: New leaderboard UI released with enhanced UI and improved performance.
60
+ NEWS = """
61
+ """
app/ui.py CHANGED
@@ -37,6 +37,9 @@ head_js += open("app/cookie.js").read()
37
  head_js += '</script>'
38
 
39
  with gr.Blocks() as about:
 
 
 
40
  gr.Markdown(ABOUT)
41
 
42
  with gr.Blocks(
 
37
  head_js += '</script>'
38
 
39
  with gr.Blocks() as about:
40
+ with gr.Row():
41
+ with gr.Accordion("News", open=False):
42
+ gr.Markdown(NEWS)
43
  gr.Markdown(ABOUT)
44
 
45
  with gr.Blocks(