Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,36 +34,30 @@ def compare_csv_files(max_num):
|
|
| 34 |
<p>Average CharacterErrorRate Difference (excluding large diffs): {f'1.5 is stronger ({avg_char_diff:.8f})' if avg_char_diff < 0 else f'1.4 is stronger ({0 - avg_char_diff:.8f})'}</p>
|
| 35 |
"""
|
| 36 |
|
| 37 |
-
def
|
| 38 |
file_1_5 = os.path.join("fish-speech-1.5", f"{uuid}.wav")
|
| 39 |
file_1_4 = os.path.join("fish-speech-1.4", f"{uuid}.wav")
|
| 40 |
-
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
for uuid in merged_df["SourceText"]:
|
| 44 |
-
file_1_5, file_1_4 = get_audio_files(uuid)
|
| 45 |
-
audio_files.append((file_1_5, file_1_4))
|
| 46 |
|
| 47 |
-
|
| 48 |
"SourceText",
|
| 49 |
"WordErrorRate_1.5", "WordErrorRate_1.4", "WordErrorRate_Comparison",
|
| 50 |
"CharacterErrorRate_1.5", "CharacterErrorRate_1.4", "CharacterErrorRate_Comparison",
|
| 51 |
-
"WhisperText_1.5", "WhisperText_1.4"
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
audio_columns = [
|
| 55 |
-
gr.Audio(value=file_1_5) for file_1_5, _ in audio_files
|
| 56 |
-
] + [
|
| 57 |
-
gr.Audio(value=file_1_4) for _, file_1_4 in audio_files
|
| 58 |
-
]
|
| 59 |
|
| 60 |
-
return
|
| 61 |
|
| 62 |
max_num = gr.Number(value=10)
|
| 63 |
gr.Interface(
|
| 64 |
fn=compare_csv_files,
|
| 65 |
inputs=[max_num],
|
| 66 |
-
outputs=
|
| 67 |
title="Fish Speech Benchmark",
|
| 68 |
description="This is a non-official model performance test from Fish Speech / Whisper Base / More data will be added later (not too much)"
|
| 69 |
).launch()
|
|
|
|
| 34 |
<p>Average CharacterErrorRate Difference (excluding large diffs): {f'1.5 is stronger ({avg_char_diff:.8f})' if avg_char_diff < 0 else f'1.4 is stronger ({0 - avg_char_diff:.8f})'}</p>
|
| 35 |
"""
|
| 36 |
|
| 37 |
+
def get_audio_html(uuid):
|
| 38 |
file_1_5 = os.path.join("fish-speech-1.5", f"{uuid}.wav")
|
| 39 |
file_1_4 = os.path.join("fish-speech-1.4", f"{uuid}.wav")
|
| 40 |
+
audio_1_5 = f'<audio controls src="{file_1_5}"></audio>' if os.path.exists(file_1_5) else "Missing Audio"
|
| 41 |
+
audio_1_4 = f'<audio controls src="{file_1_4}"></audio>' if os.path.exists(file_1_4) else "Missing Audio"
|
| 42 |
+
return audio_1_5, audio_1_4
|
| 43 |
|
| 44 |
+
merged_df["Audio_1.5"], merged_df["Audio_1.4"] = zip(*merged_df["SourceText"].apply(get_audio_html))
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
result_html = overall_summary + merged_df[[
|
| 47 |
"SourceText",
|
| 48 |
"WordErrorRate_1.5", "WordErrorRate_1.4", "WordErrorRate_Comparison",
|
| 49 |
"CharacterErrorRate_1.5", "CharacterErrorRate_1.4", "CharacterErrorRate_Comparison",
|
| 50 |
+
"WhisperText_1.5", "WhisperText_1.4",
|
| 51 |
+
"Audio_1.5", "Audio_1.4"
|
| 52 |
+
]].to_html(escape=False, index=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
return result_html
|
| 55 |
|
| 56 |
max_num = gr.Number(value=10)
|
| 57 |
gr.Interface(
|
| 58 |
fn=compare_csv_files,
|
| 59 |
inputs=[max_num],
|
| 60 |
+
outputs="html",
|
| 61 |
title="Fish Speech Benchmark",
|
| 62 |
description="This is a non-official model performance test from Fish Speech / Whisper Base / More data will be added later (not too much)"
|
| 63 |
).launch()
|