Spaces:
Sleeping
Sleeping
Spark Chou
commited on
Commit
·
f8a1dbd
1
Parent(s):
57c6f00
new
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ from concurrent.futures import ThreadPoolExecutor, TimeoutError as FutureTimeout
|
|
| 16 |
# Load dataset from HuggingFace
|
| 17 |
dataset = load_dataset("intersteller2887/Turing-test-dataset-en", split="train")
|
| 18 |
dataset = dataset.cast_column("audio", Audio(decode=False)) # Prevent calling 'torchcodec' from newer version of 'datasets'
|
| 19 |
-
|
| 20 |
# Huggingface space working directory: "/home/user/app"
|
| 21 |
target_audio_dir = "/home/user/app/audio"
|
| 22 |
os.makedirs(target_audio_dir, exist_ok=True)
|
|
@@ -884,7 +884,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container {max-width: 960px
|
|
| 884 |
with gr.Row():
|
| 885 |
with gr.Column(scale=1):
|
| 886 |
# sample_audio = gr.Audio(label="Sample Audio", value=DIMENSIONS_DATA[0]["audio"])
|
| 887 |
-
sample_audio = gr.Audio(label="Sample Audio", value=
|
| 888 |
with gr.Column(scale=2):
|
| 889 |
with gr.Column(visible=True) as interactive_view:
|
| 890 |
gr.Markdown("#### Please rate the following features (0-5 points. 0 - Feature not present; 1 - Machine; 3 - Neutral; 5 - Human)")
|
|
|
|
| 16 |
# Load dataset from HuggingFace
|
| 17 |
dataset = load_dataset("intersteller2887/Turing-test-dataset-en", split="train")
|
| 18 |
dataset = dataset.cast_column("audio", Audio(decode=False)) # Prevent calling 'torchcodec' from newer version of 'datasets'
|
| 19 |
+
sample1_audio_path = dataset[0]["audio"]['path']
|
| 20 |
# Huggingface space working directory: "/home/user/app"
|
| 21 |
target_audio_dir = "/home/user/app/audio"
|
| 22 |
os.makedirs(target_audio_dir, exist_ok=True)
|
|
|
|
| 884 |
with gr.Row():
|
| 885 |
with gr.Column(scale=1):
|
| 886 |
# sample_audio = gr.Audio(label="Sample Audio", value=DIMENSIONS_DATA[0]["audio"])
|
| 887 |
+
sample_audio = gr.Audio(label="Sample Audio", value=sample1_audio_path)
|
| 888 |
with gr.Column(scale=2):
|
| 889 |
with gr.Column(visible=True) as interactive_view:
|
| 890 |
gr.Markdown("#### Please rate the following features (0-5 points. 0 - Feature not present; 1 - Machine; 3 - Neutral; 5 - Human)")
|