ardaatahan commited on
Commit
82994f7
·
1 Parent(s): 3ea3741

SW-202 fix multilingual wer duplication and dropdown styling

Browse files
Files changed (2) hide show
  1. main.py +6 -17
  2. utils.py +1 -1
main.py CHANGED
@@ -113,26 +113,15 @@ model_to_multilingual_wer = dict(
113
  zip(multilingual_df["Model"], multilingual_df["Average WER"])
114
  )
115
 
116
- # Copy over the multilingual WER to matching models
117
- multilingual_models = {}
118
- for multilingual_model, multilingual_wer in model_to_multilingual_wer.items():
119
- for model in benchmark_df["model"].unique().tolist():
120
- if model in model_to_multilingual_wer:
121
- continue
122
- if model == "openai/whisper-large-v3-v20240930/turbo/632MB":
123
- multilingual_models[model] = model_to_multilingual_wer["openai/whisper-large-v3-v20240930"]
124
- if model.endswith("/turbo") and model.replace("/turbo", "") in model_to_multilingual_wer:
125
- multilingual_models[model] = model_to_multilingual_wer[model.replace("/turbo", "")]
126
- elif multilingual_model in model and not model.endswith("en"):
127
- multilingual_models[model] = multilingual_wer
128
-
129
- # Update the dictionary with turbo models
130
- model_to_multilingual_wer.update(multilingual_models)
131
-
132
  # Add English WER and Multilingual WER to performance_df
133
  benchmark_df["english_wer"] = benchmark_df["model"].map(model_to_english_wer)
134
  benchmark_df["multilingual_wer"] = benchmark_df["model"].map(model_to_multilingual_wer)
135
- benchmark_df.fillna({"multilingual_wer": "English-only model"}, inplace=True)
 
 
 
 
 
136
  benchmark_df["multilingual_wer"] = benchmark_df["multilingual_wer"].astype(str)
137
 
138
  sorted_performance_df = (
 
113
  zip(multilingual_df["Model"], multilingual_df["Average WER"])
114
  )
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  # Add English WER and Multilingual WER to performance_df
117
  benchmark_df["english_wer"] = benchmark_df["model"].map(model_to_english_wer)
118
  benchmark_df["multilingual_wer"] = benchmark_df["model"].map(model_to_multilingual_wer)
119
+ benchmark_df.fillna({"multilingual_wer": "N/A"}, inplace=True)
120
+
121
+ # Set multilingual_wer to "English Only Model" for English-only models
122
+ english_only_mask = benchmark_df["model"].str.contains(r"\.en$|distil-whisper", case=False, na=False)
123
+ benchmark_df.loc[english_only_mask, "multilingual_wer"] = "English Only Model"
124
+
125
  benchmark_df["multilingual_wer"] = benchmark_df["multilingual_wer"].astype(str)
126
 
127
  sorted_performance_df = (
utils.py CHANGED
@@ -909,7 +909,7 @@ strong, b {
909
  }
910
 
911
  #release-dropdown {
912
- width: 14%;
913
  margin-left: 0px;
914
  margin-right: auto;
915
  }
 
909
  }
910
 
911
  #release-dropdown {
912
+ width: 17%;
913
  margin-left: 0px;
914
  margin-right: auto;
915
  }