None1145 commited on
Commit
486a085
·
verified ·
1 Parent(s): 222974f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -8
app.py CHANGED
@@ -1,12 +1,16 @@
1
  import pandas as pd
2
  import gradio as gr
3
 
4
- def compare_csv_files(selected_languages):
5
  max_num = 10
6
 
 
 
 
 
7
  # Load data
8
- df1 = pd.read_csv("result_1.5.csv")
9
- df2 = pd.read_csv("result_1.4.csv")
10
 
11
  # Merge with Language column
12
  merged_df = pd.merge(df1, df2, on=["SourceText", "Language"], suffixes=("_1.5", "_1.4"))
@@ -54,15 +58,18 @@ def compare_csv_files(selected_languages):
54
 
55
  return result_html
56
 
57
- # Load unique languages from the data
58
- df1 = pd.read_csv("result_1.5.csv")
59
- df2 = pd.read_csv("result_1.4.csv")
60
  languages = sorted(set(df1["Language"]).union(set(df2["Language"])))
61
 
62
  gr.Interface(
63
  fn=compare_csv_files,
64
- inputs=gr.CheckboxGroup(choices=languages, label="Select Languages to Compare"),
 
 
 
65
  outputs="html",
66
  title="Fish Speech Benchmark",
67
- description="Select specific languages to compare the results of WordErrorRate and CharacterErrorRate."
68
  ).launch()
 
1
  import pandas as pd
2
  import gradio as gr
3
 
4
+ def compare_csv_files(selected_languages, model_size):
5
  max_num = 10
6
 
7
+ # Construct file names dynamically based on model size
8
+ file_1_5 = f"result_1.5_{model_size}.csv"
9
+ file_1_4 = f"result_1.4_{model_size}.csv"
10
+
11
  # Load data
12
+ df1 = pd.read_csv(file_1_5)
13
+ df2 = pd.read_csv(file_1_4)
14
 
15
  # Merge with Language column
16
  merged_df = pd.merge(df1, df2, on=["SourceText", "Language"], suffixes=("_1.5", "_1.4"))
 
58
 
59
  return result_html
60
 
61
+ # Load unique languages from the data (defaulting to Base files for initialization)
62
+ df1 = pd.read_csv("result_1.5_Base.csv")
63
+ df2 = pd.read_csv("result_1.4_Base.csv")
64
  languages = sorted(set(df1["Language"]).union(set(df2["Language"])))
65
 
66
  gr.Interface(
67
  fn=compare_csv_files,
68
+ inputs=[
69
+ gr.CheckboxGroup(choices=languages, label="Select Languages to Compare"),
70
+ gr.Dropdown(choices=["Base", "Medium"], label="Select Whisper Model Size", value="Base")
71
+ ],
72
  outputs="html",
73
  title="Fish Speech Benchmark",
74
+ description="Select specific languages and model sizes (Base or Medium) to compare the results of WordErrorRate and CharacterErrorRate."
75
  ).launch()