Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
mariesig commited on
Commit ·
32a0164
1
Parent(s): 3f6c5c8
dawn_chorus -> voice_focus_examples
Browse files- app.py +7 -5
- constants.py +1 -4
- docs/dawn_chorus.md +0 -1
- docs/example_pick.md +1 -0
- hf_dataset_utils.py +0 -1
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -104,16 +104,18 @@ with gr.Blocks() as demo:
|
|
| 104 |
)
|
| 105 |
|
| 106 |
|
| 107 |
-
with gr.Tab("
|
| 108 |
with gr.Group(elem_classes="panel section-panel"):
|
| 109 |
gr.Markdown("### Input", elem_classes="title")
|
| 110 |
-
gr.Markdown(open("docs/
|
| 111 |
|
| 112 |
dataset_dropdown = gr.Dropdown(
|
| 113 |
-
choices=ALL_FILES, value=
|
| 114 |
)
|
| 115 |
audio_file_from_dataset = gr.Audio(
|
| 116 |
-
|
|
|
|
|
|
|
| 117 |
)
|
| 118 |
|
| 119 |
with gr.Tab("Upload local file") as upload_tab:
|
|
@@ -285,5 +287,5 @@ purge_tmp_directory(max_age_minutes=0, tmp_dir=APP_TMP_DIR)
|
|
| 285 |
demo.queue()
|
| 286 |
demo.launch(
|
| 287 |
css=(_CSS_DIR / "styling.css").read_text(encoding="utf-8"),
|
| 288 |
-
allowed_paths=[APP_TMP_DIR
|
| 289 |
)
|
|
|
|
| 104 |
)
|
| 105 |
|
| 106 |
|
| 107 |
+
with gr.Tab("Pick Example") as dataset_tab:
|
| 108 |
with gr.Group(elem_classes="panel section-panel"):
|
| 109 |
gr.Markdown("### Input", elem_classes="title")
|
| 110 |
+
gr.Markdown(open("docs/example_pick.md", "r", encoding="utf-8").read(), elem_classes="tab-description")
|
| 111 |
|
| 112 |
dataset_dropdown = gr.Dropdown(
|
| 113 |
+
choices=ALL_FILES, value=ALL_FILES[0], label="Sample"
|
| 114 |
)
|
| 115 |
audio_file_from_dataset = gr.Audio(
|
| 116 |
+
label="Preview",
|
| 117 |
+
autoplay=False,
|
| 118 |
+
interactive=False,
|
| 119 |
)
|
| 120 |
|
| 121 |
with gr.Tab("Upload local file") as upload_tab:
|
|
|
|
| 287 |
demo.queue()
|
| 288 |
demo.launch(
|
| 289 |
css=(_CSS_DIR / "styling.css").read_text(encoding="utf-8"),
|
| 290 |
+
allowed_paths=[APP_TMP_DIR],
|
| 291 |
)
|
constants.py
CHANGED
|
@@ -13,11 +13,8 @@ MINUTES_KEEP: Final = 60
|
|
| 13 |
# All app temp files (spectrograms, audio, etc.) go here so we only purge our own files.
|
| 14 |
APP_TMP_DIR: Final = "/tmp/voicefocus"
|
| 15 |
|
| 16 |
-
DATASET_NAME: Final = "ai-coustics/
|
| 17 |
DEFAULT_SPLIT: Final = "eval"
|
| 18 |
-
MIX_DIR: Final = "mix"
|
| 19 |
-
SPEECH_DIR: Final = "speech"
|
| 20 |
-
TRANS_DIR: Final = "transcripts"
|
| 21 |
|
| 22 |
STREAM_EVERY: Final = 0.2
|
| 23 |
WARMUP_SECONDS: Final = 2 # seconds before "recording ready" light turns on
|
|
|
|
| 13 |
# All app temp files (spectrograms, audio, etc.) go here so we only purge our own files.
|
| 14 |
APP_TMP_DIR: Final = "/tmp/voicefocus"
|
| 15 |
|
| 16 |
+
DATASET_NAME: Final = "ai-coustics/voice-focus-examples"
|
| 17 |
DEFAULT_SPLIT: Final = "eval"
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
STREAM_EVERY: Final = 0.2
|
| 20 |
WARMUP_SECONDS: Final = 2 # seconds before "recording ready" light turns on
|
docs/dawn_chorus.md
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
Choose a sample from our open-source [Dawn Chorus evaluation dataset](https://huggingface.co/datasets/ai-coustics/dawn_chorus_en). This dataset includes audio with varying levels of background voice activity, ideal for testing the model performance.
|
|
|
|
|
|
docs/example_pick.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Select a sample from our open-source [Examples](https://huggingface.co/datasets/ai-coustics/voice-focus-examples). These audio files feature different levels of background voice activity, making them ideal for testing model performance.
|
hf_dataset_utils.py
CHANGED
|
@@ -6,7 +6,6 @@ from constants import DATASET_NAME, DEFAULT_SPLIT
|
|
| 6 |
# Load once (HF datasets handles caching; HF_TOKEN / login is used automatically if needed)
|
| 7 |
ds = load_dataset(DATASET_NAME, split=DEFAULT_SPLIT)
|
| 8 |
ds = ds.cast_column("mix", Audio(sampling_rate=16000, decode=True))
|
| 9 |
-
ds = ds.cast_column("speech", Audio(sampling_rate=16000, decode=True))
|
| 10 |
|
| 11 |
ALL_FILES = ds["id"]
|
| 12 |
|
|
|
|
| 6 |
# Load once (HF datasets handles caching; HF_TOKEN / login is used automatically if needed)
|
| 7 |
ds = load_dataset(DATASET_NAME, split=DEFAULT_SPLIT)
|
| 8 |
ds = ds.cast_column("mix", Audio(sampling_rate=16000, decode=True))
|
|
|
|
| 9 |
|
| 10 |
ALL_FILES = ds["id"]
|
| 11 |
|
requirements.txt
CHANGED
|
@@ -8,6 +8,7 @@ loguru~=0.7
|
|
| 8 |
aic-sdk>=2.0.0
|
| 9 |
dotenv
|
| 10 |
resampy
|
|
|
|
| 11 |
whisper-normalizer
|
| 12 |
soxr
|
| 13 |
datasets
|
|
|
|
| 8 |
aic-sdk>=2.0.0
|
| 9 |
dotenv
|
| 10 |
resampy
|
| 11 |
+
websockets
|
| 12 |
whisper-normalizer
|
| 13 |
soxr
|
| 14 |
datasets
|