yinanhe commited on
Commit
e6d1f05
1 Parent(s): df9540e

[update] fix overall score

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -80,7 +80,7 @@ def calculate_selected_score(df, selected_columns):
80
 
81
  def get_final_score(df, selected_columns):
82
  normalize_df = get_normalized_df(df)
83
- final_score = df.drop('name', axis=1).sum(axis=1)
84
  if 'Overall Score' in df:
85
  df['Overall Score'] = final_score
86
  else:
@@ -102,17 +102,17 @@ def get_baseline_df():
102
  df = df[present_columns]
103
  return df
104
 
105
- def get_all_df():
106
  submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
107
  submission_repo.git_pull()
108
  df = pd.read_csv(CSV_DIR)
109
- df = get_final_score(df, checkbox_group.value)
110
  df = df.sort_values(by="Selected Score", ascending=False)
111
  return df
112
 
113
  def on_filter_model_size_method_change(selected_columns):
114
- updated_data = get_all_df()
115
-
116
  # columns:
117
  selected_columns = [item for item in TASK_INFO if item in selected_columns]
118
  present_columns = MODEL_INFO + selected_columns
 
80
 
81
  def get_final_score(df, selected_columns):
82
  normalize_df = get_normalized_df(df)
83
+ final_score = normalize_df.drop('name', axis=1).sum(axis=1)
84
  if 'Overall Score' in df:
85
  df['Overall Score'] = final_score
86
  else:
 
102
  df = df[present_columns]
103
  return df
104
 
105
+ def get_all_df(selected_columns):
106
  submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
107
  submission_repo.git_pull()
108
  df = pd.read_csv(CSV_DIR)
109
+ df = get_final_score(df, selected_columns)
110
  df = df.sort_values(by="Selected Score", ascending=False)
111
  return df
112
 
113
  def on_filter_model_size_method_change(selected_columns):
114
+ updated_data = get_all_df(selected_columns)
115
+ print(updated_data)
116
  # columns:
117
  selected_columns = [item for item in TASK_INFO if item in selected_columns]
118
  present_columns = MODEL_INFO + selected_columns