kevinpro commited on
Commit
562362e
·
1 Parent(s): 017ff82

commit message

Browse files
Files changed (2) hide show
  1. __pycache__/content.cpython-38.pyc +0 -0
  2. app.py +52 -32
__pycache__/content.cpython-38.pyc CHANGED
Binary files a/__pycache__/content.cpython-38.pyc and b/__pycache__/content.cpython-38.pyc differ
 
app.py CHANGED
@@ -7,6 +7,17 @@ import gradio as gr
7
  from content import *
8
  from css import *
9
  import glob
 
 
 
 
 
 
 
 
 
 
 
10
 
11
 
12
 
@@ -82,38 +93,46 @@ def get_leaderboard_df():
82
  df = list()
83
  results = [
84
  ["GPT-3.5-Turbo", 46.6, 42.2, 49.4],
85
- ["MAmmoTH", 26.3, 21.3, 24.2],
86
- ["WizardMath", 32.5, 23.0, 28.7],
87
- ["MetaMath", 46.2, 37.0, 43.2],
88
- ["QAlign", 57.2, 49.6, 0],
89
- ["MathOctopus", 41.2, 39.5, 37.1],
90
- ["MathOctopus-MAPO-DPO(ours)🔥", 57.4, 41.6, 50.4],
91
- ["MetaMathOctopus", 53.0, 45.5, 39.2],
92
- ["MetaMathOctopus-MAPO-DPO(ours) 👑", 64.7, 51.6, 52.9],
93
- ["MistralMathOctopus", 59.0, 58.0, 56.8],
94
- ["MistralMathOctopus-MAPO-DPO(ours) 👑", 74.6, 67.3, 70.0]
95
  ]
96
- # for (pretrained, lang), perfs in performance_dict.items():
97
- # lang_name = LANG_NAME[lang]
98
- # arc_perf = perfs.get(ARC, 0.0)
99
- # hellaswag_perf = perfs.get(HELLASWAG, 0.0)
100
- # mmlu_perf = perfs.get(MMLU, 0.0)
101
- # truthfulqa_perf = perfs.get(TRUTHFULQA, 0.0)
102
-
103
- # if arc_perf * hellaswag_perf * mmlu_perf * truthfulqa_perf == 0:
104
- # continue
105
- # avg = round((arc_perf + hellaswag_perf + mmlu_perf + truthfulqa_perf) / 4, 1)
106
- # notes = ' '.join([pretrained, lang_name])
107
- # row = [pretrained, lang_name, lang, avg, arc_perf, hellaswag_perf, mmlu_perf, truthfulqa_perf, notes]
108
- # df.append(row)
109
  for i in results:
110
- i.append("NOTE")
111
  df = pd.DataFrame.from_records(results, columns=COLS)
112
  df = df.sort_values(by=[ MSVAMP_COL], ascending=False)
113
  df = df[COLS]
114
 
115
  return df
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
  def search_table(df, query):
119
  filtered_df = df[df[NOTES_COL].str.contains(query, case=False)]
@@ -122,6 +141,7 @@ def search_table(df, query):
122
 
123
 
124
  original_df = get_leaderboard_df()
 
125
 
126
  demo = gr.Blocks(css=CUSTOM_CSS)
127
  with demo:
@@ -133,7 +153,7 @@ with demo:
133
  search_bar = gr.Textbox(
134
  placeholder="Search models and languages...", show_label=False, elem_id="search-bar"
135
  )
136
-
137
  leaderboard_table = gr.components.Dataframe(
138
  value=original_df,
139
  headers=COLS,
@@ -157,9 +177,9 @@ with demo:
157
  search_bar = gr.Textbox(
158
  placeholder="Search models and languages...", show_label=False, elem_id="search-bar"
159
  )
160
-
161
- leaderboard_table = gr.components.Dataframe(
162
- value=original_df,
163
  headers=COLS,
164
  datatype=TYPES,
165
  max_rows=5,
@@ -167,14 +187,14 @@ with demo:
167
  )
168
 
169
  # # Dummy leaderboard for handling the case when the user uses backspace key
170
- hidden_leaderboard_table_for_search = gr.components.Dataframe(
171
- value=original_df, headers=COLS, datatype=TYPES, max_rows=5, visible=False
172
  )
173
 
174
  search_bar.change(
175
  search_table,
176
- [hidden_leaderboard_table_for_search, search_bar],
177
- leaderboard_table,
178
  )
179
 
180
  #gr.Markdown(CREDIT, elem_classes="markdown-text")
 
7
  from content import *
8
  from css import *
9
  import glob
10
+ import pandas as pd
11
+
12
+
13
+ # 假设 original_df 是一个 pandas DataFrame,并且 COLS 和 TYPES 是已经定义好的列名和数据类型列表。
14
+
15
+ # 定义一个函数,用于格式化浮点数为保留一位小数的字符串
16
+ def format_floats(val):
17
+ if val:
18
+ if isinstance(val, float):
19
+ return f"{val:.1f}"
20
+ return val
21
 
22
 
23
 
 
93
  df = list()
94
  results = [
95
  ["GPT-3.5-Turbo", 46.6, 42.2, 49.4],
96
+ ["MAmmoTH 7B", 26.3, 21.3, 24.2],
97
+ ["WizardMath 7B", 32.5, 23.0, 28.7],
98
+ ["MetaMath 7B", 46.2, 37.0, 43.2],
99
+ ["QAlign 7B", 57.2, 49.6, None],
100
+ ["MathOctopus 7B", 41.2, 39.5, 37.1],
101
+ ["MathOctopus-MAPO-DPO 7B(ours)🔥", 57.4, 41.6, 50.4],
102
+ ["MetaMathOctopus 7B", 53.0, 45.5, 39.2],
103
+ ["MetaMathOctopus-MAPO-DPO 7B(ours) 👑", 64.7, 51.6, 52.9],
104
+ ["MistralMathOctopus 7B", 59.0, 58.0, 56.8],
105
+ ["MistralMathOctopus-MAPO-DPO 7B(ours) 👑", 74.6, 67.3, 70.0]
106
  ]
107
+
 
 
 
 
 
 
 
 
 
 
 
 
108
  for i in results:
109
+ i.append(i[0])
110
  df = pd.DataFrame.from_records(results, columns=COLS)
111
  df = df.sort_values(by=[ MSVAMP_COL], ascending=False)
112
  df = df[COLS]
113
 
114
  return df
115
 
116
+ def get_leaderboard_13Bdf():
117
+ df = list()
118
+ results = [
119
+ ["GPT-3.5-Turbo", 46.6, 42.2, 49.4],
120
+ ["MAmmoTH 13B", 38.6, 28.9, 29.5],
121
+ ["WizardMath 13B", 35.7, 28.3, 29.0],
122
+ ["MetaMath 13B", 46.2, 43.9, 43.3],
123
+ ["QAlign 13B", 62.6, 57.1, None],
124
+ ["MathOctopus 13B", 51.8, 46.0, 40.3],
125
+ ["MathOctopus-MAPO-DPO 13B (ours) 🔥", 60.1, 48.5, 53.8],
126
+ ["MetaMathOctopus 13B", 56.3, 51.4, 49.5],
127
+ ["MetaMathOctopus-MAPO-DPO 13B (ours) 👑", 67.0, 58.0, 59.8]
128
+ ]
129
+ for i in results:
130
+ i.append(i[0])
131
+ df = pd.DataFrame.from_records(results, columns=COLS)
132
+ df = df.sort_values(by=[ MSVAMP_COL], ascending=False)
133
+ df = df[COLS]
134
+
135
+ return df
136
 
137
  def search_table(df, query):
138
  filtered_df = df[df[NOTES_COL].str.contains(query, case=False)]
 
141
 
142
 
143
  original_df = get_leaderboard_df()
144
+ original_13Bdf = get_leaderboard_13Bdf()
145
 
146
  demo = gr.Blocks(css=CUSTOM_CSS)
147
  with demo:
 
153
  search_bar = gr.Textbox(
154
  placeholder="Search models and languages...", show_label=False, elem_id="search-bar"
155
  )
156
+ original_df = original_df.applymap(format_floats)
157
  leaderboard_table = gr.components.Dataframe(
158
  value=original_df,
159
  headers=COLS,
 
177
  search_bar = gr.Textbox(
178
  placeholder="Search models and languages...", show_label=False, elem_id="search-bar"
179
  )
180
+ original_13Bdf = original_13Bdf.applymap(format_floats)
181
+ leaderboard_table_13B = gr.components.Dataframe(
182
+ value=original_13Bdf,
183
  headers=COLS,
184
  datatype=TYPES,
185
  max_rows=5,
 
187
  )
188
 
189
  # # Dummy leaderboard for handling the case when the user uses backspace key
190
+ hidden_leaderboard_table_for_search_13B = gr.components.Dataframe(
191
+ value=original_13Bdf, headers=COLS, datatype=TYPES, max_rows=5, visible=False
192
  )
193
 
194
  search_bar.change(
195
  search_table,
196
+ [hidden_leaderboard_table_for_search_13B, search_bar],
197
+ leaderboard_table_13B,
198
  )
199
 
200
  #gr.Markdown(CREDIT, elem_classes="markdown-text")