Ziqi commited on
Commit
9a97f7c
1 Parent(s): 1bc7a7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -38,7 +38,7 @@ def add_new_eval(
38
  model_name = model_name_textbox
39
  else:
40
  model_name = revision_name_textbox
41
- model_name_list = csv_data['Model Name']
42
  name_list = [name.split(']')[0][1:] for name in model_name_list]
43
  if revision_name_textbox not in name_list:
44
  col = csv_data.shape[0]
@@ -65,7 +65,7 @@ def add_new_eval(
65
  return 0
66
 
67
  def get_normalized_df(df):
68
- # final_score = df.drop('Model Name', axis=1).sum(axis=1)
69
  # df.insert(1, 'Overall Score', final_score)
70
  normalize_df = df.copy()
71
  for column in normalize_df.columns[1:]:
@@ -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 = normalize_df.drop('Model Name', axis=1).sum(axis=1)
84
  if 'Overall Score' in df:
85
  df['Overall Score'] = final_score
86
  else:
@@ -112,8 +112,8 @@ def get_all_df(selected_columns):
112
  return df
113
 
114
  def convert_scores_to_percentage(df):
115
- # 对DataFrame中的每一列(除了'Model Name'列)进行操作
116
- for column in df.columns[1:]: # 假设第一列是'Model Name'
117
  df[column] = round(df[column] * 100,2) # 将分数转换为百分数
118
  df[column] = df[column].astype(str) + '%'
119
  return df
 
38
  model_name = model_name_textbox
39
  else:
40
  model_name = revision_name_textbox
41
+ model_name_list = csv_data['name']
42
  name_list = [name.split(']')[0][1:] for name in model_name_list]
43
  if revision_name_textbox not in name_list:
44
  col = csv_data.shape[0]
 
65
  return 0
66
 
67
  def get_normalized_df(df):
68
+ # final_score = df.drop('name', axis=1).sum(axis=1)
69
  # df.insert(1, 'Overall Score', final_score)
70
  normalize_df = df.copy()
71
  for column in normalize_df.columns[1:]:
 
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:
 
112
  return df
113
 
114
  def convert_scores_to_percentage(df):
115
+ # 对DataFrame中的每一列(除了'name'列)进行操作
116
+ for column in df.columns[1:]: # 假设第一列是'name'
117
  df[column] = round(df[column] * 100,2) # 将分数转换为百分数
118
  df[column] = df[column].astype(str) + '%'
119
  return df