ymk00 commited on
Commit
7fd340f
·
1 Parent(s): b90f3e9

Update metrics

Browse files
backend/app/services/leaderboard.py CHANGED
@@ -104,32 +104,67 @@ class LeaderboardService:
104
 
105
  # Create unique ID combining model name, precision, sha and chat template status
106
  unique_id = f"{data.get('fullname', 'Unknown')}_{data.get('Precision', 'Unknown')}_{data.get('Model sha', 'Unknown')}_{str(data.get('Chat Template', False))}"
107
-
108
  evaluations = {
109
- "multifin": {
110
- "name": "MultiFin",
111
- "value": data.get("MultiFin Raw", 0),
112
- "normalized_score": data.get("MultiFin", 0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  },
114
- "qa": {
115
- "name": "QA",
116
- "value": data.get("QA Raw", 0),
117
- "normalized_score": data.get("QA", 0)
118
  },
119
- "fns": {
120
- "name": "FNS",
121
- "value": data.get("FNS Raw", 0),
122
- "normalized_score": data.get("FNS", 0)
123
  },
124
- "finnum": {
125
- "name": "FinNum",
126
- "value": data.get("FinNum Raw", 0),
127
- "normalized_score": data.get("FinNum", 0)
128
  },
129
- "fintext": {
130
- "name": "FinText",
131
- "value": data.get("FinText Raw", 0),
132
- "normalized_score": data.get("FinText", 0)
133
  },
134
  }
135
 
 
104
 
105
  # Create unique ID combining model name, precision, sha and chat template status
106
  unique_id = f"{data.get('fullname', 'Unknown')}_{data.get('Precision', 'Unknown')}_{data.get('Model sha', 'Unknown')}_{str(data.get('Chat Template', False))}"
107
+
108
  evaluations = {
109
+ "bc5cdr_chemical": {
110
+ "name": "BC5CDR-chemical",
111
+ "value": data.get("BC5CDR-chemical", 0),
112
+ "normalized_score": data.get("BC5CDR-chemical", 0),
113
+ },
114
+ "ncbi_disease": {
115
+ "name": "NCBI Disease",
116
+ "value": data.get("NCBI Disease", 0),
117
+ "normalized_score": data.get("NCBI Disease", 0),
118
+ },
119
+ "chemprot": {
120
+ "name": "ChemProt",
121
+ "value": data.get("ChemProt", 0),
122
+ "normalized_score": data.get("ChemProt", 0),
123
+ },
124
+ "ddi2013": {
125
+ "name": "DDI2013",
126
+ "value": data.get("DDI2013", 0),
127
+ "normalized_score": data.get("DDI2013", 0),
128
+ },
129
+ "hoc": {
130
+ "name": "HoC",
131
+ "value": data.get("HoC", 0),
132
+ "normalized_score": data.get("HoC", 0),
133
+ },
134
+ "litcovid": {
135
+ "name": "LitCovid",
136
+ "value": data.get("LitCovid", 0),
137
+ "normalized_score": data.get("LitCovid", 0),
138
+ },
139
+ "medqa": {
140
+ "name": "MedQA (5-Option)",
141
+ "value": data.get("MedQA (5-Option)", 0),
142
+ "normalized_score": data.get("MedQA (5-Option)", 0),
143
+ },
144
+ "pubmedqa": {
145
+ "name": "PubMedQA",
146
+ "value": data.get("PubMedQA", 0),
147
+ "normalized_score": data.get("PubMedQA", 0),
148
  },
149
+ "pubmed": {
150
+ "name": "PubMed",
151
+ "value": data.get("PubMed", 0),
152
+ "normalized_score": data.get("PubMed", 0),
153
  },
154
+ "ms2": {
155
+ "name": "MS^2",
156
+ "value": data.get("MS^2", 0),
157
+ "normalized_score": data.get("MS^2", 0),
158
  },
159
+ "cochrane_pls": {
160
+ "name": "Cochrane PLS",
161
+ "value": data.get("Cochrane PLS", 0),
162
+ "normalized_score": data.get("Cochrane PLS", 0),
163
  },
164
+ "plos": {
165
+ "name": "PLOS",
166
+ "value": data.get("PLOS", 0),
167
+ "normalized_score": data.get("PLOS", 0),
168
  },
169
  }
170
 
frontend/src/pages/LeaderboardPage/components/Leaderboard/constants/defaults.js CHANGED
@@ -98,158 +98,200 @@ const COLUMN_SIZES = {
98
 
99
  // Column definitions with organized structure
100
  const COLUMNS = {
101
- FIXED: {
102
- rank: {
103
- group: "fixed",
104
- size: COLUMN_SIZES.RANK,
105
- defaultVisible: true,
106
- label: "Rank",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  },
108
- "model.type_icon": {
109
- group: "fixed",
110
- size: COLUMN_SIZES.TYPE_ICON,
111
- defaultVisible: true,
112
- label: "Type",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  },
114
- id: {
115
- group: "fixed",
116
- size: COLUMN_SIZES.MODEL,
117
- defaultVisible: true,
118
- label: "Model",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  },
120
- "model.average_score": {
121
- group: "fixed",
122
- size: COLUMN_SIZES.AVERAGE_SCORE,
123
- defaultVisible: true,
124
- label: "Average Score",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  },
126
- },
127
- EVALUATION: {
128
- "evaluations.multifin.normalized_score": {
129
- group: "evaluation",
130
- size: COLUMN_SIZES.BENCHMARK,
131
- defaultVisible: true,
132
- label: "MultiFin",
133
- },
134
- "evaluations.qa.normalized_score": {
135
- group: "evaluation",
136
- size: COLUMN_SIZES.BENCHMARK,
137
- defaultVisible: true,
138
- label: "QA",
139
- },
140
- "evaluations.fns.normalized_score": {
141
- group: "evaluation",
142
- size: COLUMN_SIZES.BENCHMARK,
143
- defaultVisible: true,
144
- label: "FNS",
145
- },
146
- "evaluations.finnum.normalized_score": {
147
- group: "evaluation",
148
- size: COLUMN_SIZES.BENCHMARK,
149
- defaultVisible: true,
150
- label: "FinNum",
151
- },
152
- "evaluations.fintext.normalized_score": {
153
- group: "evaluation",
154
- size: COLUMN_SIZES.BENCHMARK,
155
- defaultVisible: true,
156
- label: "FinText",
157
- },
158
- },
159
- MODEL_INFO: {
160
- "metadata.co2_cost": {
161
- group: "model_info",
162
- size: COLUMN_SIZES.CO2_COST,
163
- defaultVisible: true,
164
- label: "CO₂ Cost (kg)",
165
- },
166
- "metadata.hub_hearts": {
167
- group: "model_info",
168
- size: COLUMN_SIZES.HUB_HEARTS,
169
- defaultVisible: false,
170
- label: "Hub ❤️",
171
- },
172
- "model.architecture": {
173
- group: "model_info",
174
- size: COLUMN_SIZES.ARCHITECTURE,
175
- defaultVisible: false,
176
- label: "Architecture",
177
- },
178
- "model.precision": {
179
- group: "model_info",
180
- size: COLUMN_SIZES.PRECISION,
181
- defaultVisible: false,
182
- label: "Precision",
183
- },
184
- "metadata.params_billions": {
185
- group: "model_info",
186
- size: COLUMN_SIZES.PARAMS,
187
- defaultVisible: false,
188
- label: "Parameters (B)",
189
- },
190
- "metadata.hub_license": {
191
- group: "model_info",
192
- size: COLUMN_SIZES.LICENSE,
193
- defaultVisible: false,
194
- label: "License",
195
- },
196
- "model.has_chat_template": {
197
- group: "model_info",
198
- size: COLUMN_SIZES.CHAT_TEMPLATE,
199
- defaultVisible: false,
200
- label: "Chat Template",
201
- },
202
- },
203
- ADDITIONAL_INFO: {
204
- "metadata.upload_date": {
205
- group: "additional_info",
206
- size: COLUMN_SIZES.UPLOAD_DATE,
207
- defaultVisible: false,
208
- label: "Upload Date",
209
- },
210
- "metadata.submission_date": {
211
- group: "additional_info",
212
- size: COLUMN_SIZES.SUBMISSION_DATE,
213
- defaultVisible: false,
214
- label: "Submission Date",
215
- },
216
- "metadata.generation": {
217
- group: "additional_info",
218
- size: COLUMN_SIZES.GENERATION,
219
- defaultVisible: false,
220
- label: "Generation",
221
- },
222
- "metadata.base_model": {
223
- group: "additional_info",
224
- size: COLUMN_SIZES.BASE_MODEL,
225
- defaultVisible: false,
226
- label: "Base Model",
227
- },
228
- "features.is_not_available_on_hub": {
229
- group: "additional_info",
230
- size: COLUMN_SIZES.HUB_AVAILABILITY,
231
- defaultVisible: false,
232
- label: "Hub Availability",
233
- },
234
- "features.is_highlighted_by_maintainer": {
235
- group: "additional_info",
236
- size: COLUMN_SIZES.OFFICIAL_PROVIDER,
237
- defaultVisible: false,
238
- label: "Only Official Providers",
239
- },
240
- "features.is_moe": {
241
- group: "additional_info",
242
- size: COLUMN_SIZES.MOE,
243
- defaultVisible: false,
244
- label: "Mixture of Experts",
245
- },
246
- "features.is_flagged": {
247
- group: "additional_info",
248
- size: COLUMN_SIZES.FLAG_STATUS,
249
- defaultVisible: false,
250
- label: "Flag Status",
251
- },
252
- },
253
  };
254
 
255
  // Combine all columns for backward compatibility
 
98
 
99
  // Column definitions with organized structure
100
  const COLUMNS = {
101
+ FIXED: {
102
+ rank: {
103
+ group: "fixed",
104
+ size: COLUMN_SIZES.RANK,
105
+ defaultVisible: true,
106
+ label: "Rank",
107
+ },
108
+ "model.type_icon": {
109
+ group: "fixed",
110
+ size: COLUMN_SIZES.TYPE_ICON,
111
+ defaultVisible: true,
112
+ label: "Type",
113
+ },
114
+ id: {
115
+ group: "fixed",
116
+ size: COLUMN_SIZES.MODEL,
117
+ defaultVisible: true,
118
+ label: "Model",
119
+ },
120
+ "model.average_score": {
121
+ group: "fixed",
122
+ size: COLUMN_SIZES.AVERAGE_SCORE,
123
+ defaultVisible: true,
124
+ label: "Average Score",
125
+ },
126
  },
127
+ EVALUATION: {
128
+ "evaluations.bc5cdr_chemical.normalized_score": {
129
+ group: "evaluation",
130
+ size: COLUMN_SIZES.BENCHMARK,
131
+ defaultVisible: true,
132
+ label: "BC5CDR-chemical",
133
+ },
134
+ "evaluations.ncbi_disease.normalized_score": {
135
+ group: "evaluation",
136
+ size: COLUMN_SIZES.BENCHMARK,
137
+ defaultVisible: true,
138
+ label: "NCBI Disease",
139
+ },
140
+ "evaluations.chemprot.normalized_score": {
141
+ group: "evaluation",
142
+ size: COLUMN_SIZES.BENCHMARK,
143
+ defaultVisible: true,
144
+ label: "ChemProt",
145
+ },
146
+ "evaluations.ddi2013.normalized_score": {
147
+ group: "evaluation",
148
+ size: COLUMN_SIZES.BENCHMARK,
149
+ defaultVisible: true,
150
+ label: "DDI2013",
151
+ },
152
+ "evaluations.hoc.normalized_score": {
153
+ group: "evaluation",
154
+ size: COLUMN_SIZES.BENCHMARK,
155
+ defaultVisible: true,
156
+ label: "HoC",
157
+ },
158
+ "evaluations.litcovid.normalized_score": {
159
+ group: "evaluation",
160
+ size: COLUMN_SIZES.BENCHMARK,
161
+ defaultVisible: true,
162
+ label: "LitCovid",
163
+ },
164
+ "evaluations.medqa.normalized_score": {
165
+ group: "evaluation",
166
+ size: COLUMN_SIZES.BENCHMARK,
167
+ defaultVisible: true,
168
+ label: "MedQA (5-Option)",
169
+ },
170
+ "evaluations.pubmedqa.normalized_score": {
171
+ group: "evaluation",
172
+ size: COLUMN_SIZES.BENCHMARK,
173
+ defaultVisible: true,
174
+ label: "PubMedQA",
175
+ },
176
+ "evaluations.pubmed.normalized_score": {
177
+ group: "evaluation",
178
+ size: COLUMN_SIZES.BENCHMARK,
179
+ defaultVisible: true,
180
+ label: "PubMed",
181
+ },
182
+ "evaluations.ms2.normalized_score": {
183
+ group: "evaluation",
184
+ size: COLUMN_SIZES.BENCHMARK,
185
+ defaultVisible: true,
186
+ label: "MS^2",
187
+ },
188
+ "evaluations.cochrane_pls.normalized_score": {
189
+ group: "evaluation",
190
+ size: COLUMN_SIZES.BENCHMARK,
191
+ defaultVisible: true,
192
+ label: "Cochrane PLS",
193
+ },
194
+ "evaluations.plos.normalized_score": {
195
+ group: "evaluation",
196
+ size: COLUMN_SIZES.BENCHMARK,
197
+ defaultVisible: true,
198
+ label: "PLOS",
199
+ },
200
  },
201
+ MODEL_INFO: {
202
+ "metadata.co2_cost": {
203
+ group: "model_info",
204
+ size: COLUMN_SIZES.CO2_COST,
205
+ defaultVisible: true,
206
+ label: "CO₂ Cost (kg)",
207
+ },
208
+ "metadata.hub_hearts": {
209
+ group: "model_info",
210
+ size: COLUMN_SIZES.HUB_HEARTS,
211
+ defaultVisible: false,
212
+ label: "Hub ❤️",
213
+ },
214
+ "model.architecture": {
215
+ group: "model_info",
216
+ size: COLUMN_SIZES.ARCHITECTURE,
217
+ defaultVisible: false,
218
+ label: "Architecture",
219
+ },
220
+ "model.precision": {
221
+ group: "model_info",
222
+ size: COLUMN_SIZES.PRECISION,
223
+ defaultVisible: false,
224
+ label: "Precision",
225
+ },
226
+ "metadata.params_billions": {
227
+ group: "model_info",
228
+ size: COLUMN_SIZES.PARAMS,
229
+ defaultVisible: false,
230
+ label: "Parameters (B)",
231
+ },
232
+ "metadata.hub_license": {
233
+ group: "model_info",
234
+ size: COLUMN_SIZES.LICENSE,
235
+ defaultVisible: false,
236
+ label: "License",
237
+ },
238
+ "model.has_chat_template": {
239
+ group: "model_info",
240
+ size: COLUMN_SIZES.CHAT_TEMPLATE,
241
+ defaultVisible: false,
242
+ label: "Chat Template",
243
+ },
244
  },
245
+ ADDITIONAL_INFO: {
246
+ "metadata.upload_date": {
247
+ group: "additional_info",
248
+ size: COLUMN_SIZES.UPLOAD_DATE,
249
+ defaultVisible: false,
250
+ label: "Upload Date",
251
+ },
252
+ "metadata.submission_date": {
253
+ group: "additional_info",
254
+ size: COLUMN_SIZES.SUBMISSION_DATE,
255
+ defaultVisible: false,
256
+ label: "Submission Date",
257
+ },
258
+ "metadata.generation": {
259
+ group: "additional_info",
260
+ size: COLUMN_SIZES.GENERATION,
261
+ defaultVisible: false,
262
+ label: "Generation",
263
+ },
264
+ "metadata.base_model": {
265
+ group: "additional_info",
266
+ size: COLUMN_SIZES.BASE_MODEL,
267
+ defaultVisible: false,
268
+ label: "Base Model",
269
+ },
270
+ "features.is_not_available_on_hub": {
271
+ group: "additional_info",
272
+ size: COLUMN_SIZES.HUB_AVAILABILITY,
273
+ defaultVisible: false,
274
+ label: "Hub Availability",
275
+ },
276
+ "features.is_highlighted_by_maintainer": {
277
+ group: "additional_info",
278
+ size: COLUMN_SIZES.OFFICIAL_PROVIDER,
279
+ defaultVisible: false,
280
+ label: "Only Official Providers",
281
+ },
282
+ "features.is_moe": {
283
+ group: "additional_info",
284
+ size: COLUMN_SIZES.MOE,
285
+ defaultVisible: false,
286
+ label: "Mixture of Experts",
287
+ },
288
+ "features.is_flagged": {
289
+ group: "additional_info",
290
+ size: COLUMN_SIZES.FLAG_STATUS,
291
+ defaultVisible: false,
292
+ label: "Flag Status",
293
+ },
294
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  };
296
 
297
  // Combine all columns for backward compatibility
frontend/src/pages/LeaderboardPage/components/Leaderboard/constants/tooltips.js CHANGED
@@ -29,209 +29,289 @@ const createTooltipContent = (title, items) => (
29
  );
30
 
31
  export const COLUMN_TOOLTIPS = {
32
- AVERAGE: createTooltipContent("Average score across all benchmarks:", [
33
- {
34
- label: "Calculation",
35
- description: "Weighted average of normalized scores from all benchmarks",
36
- subItems: [
37
- "Each benchmark is normalized to a 0-100 scale",
38
- "All normalised benchmarks are then averaged together",
39
- ],
40
- },
41
- ]),
 
42
 
43
- MULTIFIN: createTooltipContent("Multilingual Financial NLP (MultiFin):", [
44
- {
45
- label: "Purpose",
46
- description:
47
- "Tests model's ability to understand real-world financial article headlines",
48
- subItems: ["Language Understanding", "Topic Classification"],
49
- },
50
- {
51
- label: "Scoring: ACC Norm",
52
- description: "Was the correct choice selected among the options.",
53
- },
54
- ]),
55
 
56
- QA: createTooltipContent("Greek Financial Question Answering (QA):", [
57
- {
58
- label: "Purpose",
59
- description:
60
- "Tests model's ability to understand real-world Greek financial exam questions",
61
- subItems: ["Language Understanding", "Question Answering"],
62
- },
63
- {
64
- label: "Scoring: ACC Norm",
65
- description: "Was the correct choice selected among the options.",
66
- },
67
- ]),
68
 
69
- FNS: createTooltipContent("Financial Narrative Summarization (FNS):", [
70
- {
71
- label: "Purpose",
72
- description:
73
- "Tests model's ability to summarize real-world financial annual reports",
74
- subItems: ["Language Understanding", "Abstractive Summarization"],
75
- },
76
- {
77
- label: "Scoring: Rouge1",
78
- description: "Was the overlap of unigrams (each word) between the predicted and reference summaries.",
79
- },
80
- ]),
81
 
82
- FinNum: createTooltipContent("Financial Number Entity Recognition (FinNum):", [
83
- {
84
- label: "Purpose",
85
- description:
86
- "Tests model's ability to recognize numbers from financial texts",
87
- subItems: ["Language Understanding", "Named Entity Recognition"],
88
- },
89
- {
90
- label: "Scoring: Rouge1",
91
- description: "Was the overlap of unigrams (each word) between the predicted and reference summaries.",
92
- },
93
- ]),
94
 
95
- FinText: createTooltipContent("Financial Named Entity Recognition (FinText):", [
96
- {
97
- label: "Purpose",
98
- description:
99
- "Tests model's ability to recognize financial entities, i.e, person, location, and organization",
100
- subItems: ["Language Understanding", "Named Entity Recognition"],
101
- },
102
- {
103
- label: "Scoring: Rouge1",
104
- description: "Was the overlap of unigrams (each word) between the predicted and reference summaries.",
105
- },
106
- ]),
107
 
108
- ARCHITECTURE: createTooltipContent("Model Architecture Information:", [
109
- {
110
- label: "Definition",
111
- description: "The fundamental structure and design of the model",
112
- subItems: [
113
- "Pretrained: Foundational models, initially trained on large datasets without task-specific tuning, serving as a versatile base for further development.",
114
- "Continuously Pretrained: Base models trained with a data mix evolving as the model is trained, with the addition of specialized data during the last training steps.",
115
- "Fine-tuned: Base models, fine-tuned on specialised domain data (legal, medical, ...), and optimized for particular tasks.",
116
- "Chat: Models fine-tuned with IFT, RLHF, DPO, and other techniques, to handle conversational contexts effectively.",
117
- "Merged: Combining multiple models through weights averaging or similar methods.",
118
- "Multimodal: Models which can handle several modalities (text & image/audio/video/...). We only evaluate the text capabilities.",
119
- ],
120
- },
121
- {
122
- label: "Impact",
123
- description: "How architecture affects model capabilities",
124
- subItems: [
125
- "Base models are expected to perform less well on instruction following evaluations, like IFEval.",
126
- "Fine-tuned and chat models can be more verbose and more chatty than base models.",
127
- "Merged models tend to exhibit good performance on benchmarks, which do not translate to real-world situations.",
128
- ],
129
- },
130
- ]),
131
 
132
- PRECISION: createTooltipContent("Numerical Precision Format:", [
133
- {
134
- label: "Overview",
135
- description:
136
- "Data format used to store model weights and perform computations",
137
- subItems: [
138
- "bfloat16: Half precision (Brain Float format), good for stability",
139
- "float16: Half precision",
140
- "8bit/4bit: Quantized formats, for efficiency",
141
- "GPTQ/AWQ: Quantized methods",
142
- ],
143
- },
144
- {
145
- label: "Impact",
146
- description: "How precision affects model deployment",
147
- subItems: [
148
- "Higher precision = better accuracy but more memory usage",
149
- "Lower precision = faster inference and smaller size",
150
- "Trade-off between model quality and resource usage",
151
- ],
152
- },
153
- ]),
154
 
155
- FLAGS: createTooltipContent("Model Flags and Special Features:", [
156
- {
157
- label: "Filters",
158
- subItems: [
159
- "Mixture of Expert: Uses a MoE architecture",
160
- "Merged models: Created by averaging other models",
161
- "Contaminated: Flagged by users from the community for (possibly accidental) cheating",
162
- "Unavailable: No longer on the hub (private, deleted) or missing a license tag",
163
- ],
164
- },
165
- {
166
- label: "Purpose",
167
- description: "Why do people want to hide these models?",
168
- subItems: [
169
- "Mixture of Experts: These models can be too parameter heavy",
170
- "Merged models: Performance on benchmarks tend to be inflated compared to real life usage",
171
- "Contaminated: Performance on benchmarks is inflated and not reflecting real life usage",
172
- ],
173
- },
174
- ]),
175
 
176
- PARAMETERS: createTooltipContent("Model Parameters:", [
177
- {
178
- label: "Measurement",
179
- description: "Total number of trainable parameters in billions",
180
- subItems: [
181
- "Indicates model capacity and complexity",
182
- "Correlates with computational requirements",
183
- "Influences memory usage and inference speed",
184
- ],
185
- },
186
- ]),
187
 
188
- LICENSE: createTooltipContent("Model License Information:", [
189
- {
190
- label: "Importance",
191
- description: "Legal terms governing model usage and distribution",
192
- subItems: [
193
- "Commercial vs non-commercial use",
194
- "Attribution requirements",
195
- "Modification and redistribution rights",
196
- "Liability and warranty terms",
197
- ],
198
- },
199
- ]),
200
 
201
- CO2_COST: createTooltipContent("Carbon Dioxide Emissions:", [
202
- {
203
- label: "What is it?",
204
- description: "CO₂ emissions of the model evaluation ",
205
- subItems: [
206
- "Only focuses on model inference for our specific setup",
207
- "Considers data center location and energy mix",
208
- "Allows equivalent comparision of models on our use case",
209
- ],
210
- },
211
- {
212
- label: "Why it matters",
213
- description: "Environmental impact of AI model training",
214
- subItems: [
215
- "Large models can have significant carbon footprints",
216
- "Helps make informed choices about model selection",
217
- ],
218
- },
219
- {
220
- label: "Learn more",
221
- description:
222
- "For detailed information about our CO₂ calculation methodology, visit:",
223
- subItems: [
224
- <a
225
- href="https://huggingface.co/docs/leaderboards/open_llm_leaderboard/emissions"
226
- target="_blank"
227
- rel="noopener noreferrer"
228
- style={{ color: "#90caf9" }}
229
- >
230
- Carbon Emissions Documentation
231
- </a>,
232
- ],
233
- },
234
- ]),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  };
236
 
237
  export const UI_TOOLTIPS = {
 
29
  );
30
 
31
  export const COLUMN_TOOLTIPS = {
32
+ AVERAGE: createTooltipContent("Average score across all benchmarks:", [
33
+ {
34
+ label: "Calculation",
35
+ description:
36
+ "Weighted average of normalized scores from all benchmarks",
37
+ subItems: [
38
+ "Each benchmark is normalized to a 0-100 scale",
39
+ "All normalised benchmarks are then averaged together",
40
+ ],
41
+ },
42
+ ]),
43
 
44
+ BC5CDR_CHEMICAL: createTooltipContent("Placeholder", [
45
+ {
46
+ label: "Purpose",
47
+ description: "Placeholder",
48
+ subItems: ["Placeholder", "Placeholder"],
49
+ },
50
+ {
51
+ label: "Scoring: Placeholder",
52
+ description: "Placeholder",
53
+ },
54
+ ]),
 
55
 
56
+ NCBI_DISEASE: createTooltipContent("Placeholder", [
57
+ {
58
+ label: "Purpose",
59
+ description: "Placeholder",
60
+ subItems: ["Placeholder", "Placeholder"],
61
+ },
62
+ {
63
+ label: "Scoring: Placeholder",
64
+ description: "Placeholder",
65
+ },
66
+ ]),
 
67
 
68
+ CHEMPROT: createTooltipContent("Placeholder", [
69
+ {
70
+ label: "Purpose",
71
+ description: "Placeholder",
72
+ subItems: ["Placeholder", "Placeholder"],
73
+ },
74
+ {
75
+ label: "Scoring: Placeholder",
76
+ description: "Placeholder",
77
+ },
78
+ ]),
 
79
 
80
+ DDI2013: createTooltipContent("Placeholder", [
81
+ {
82
+ label: "Purpose",
83
+ description: "Placeholder",
84
+ subItems: ["Placeholder", "Placeholder"],
85
+ },
86
+ {
87
+ label: "Scoring: Placeholder",
88
+ description: "Placeholder",
89
+ },
90
+ ]),
 
91
 
92
+ HOC: createTooltipContent("Placeholder", [
93
+ {
94
+ label: "Purpose",
95
+ description: "Placeholder",
96
+ subItems: ["Placeholder", "Placeholder"],
97
+ },
98
+ {
99
+ label: "Scoring: Placeholder",
100
+ description: "Placeholder",
101
+ },
102
+ ]),
 
103
 
104
+ LITCOVID: createTooltipContent("Placeholder", [
105
+ {
106
+ label: "Purpose",
107
+ description: "Placeholder",
108
+ subItems: ["Placeholder", "Placeholder"],
109
+ },
110
+ {
111
+ label: "Scoring: Placeholder",
112
+ description: "Placeholder",
113
+ },
114
+ ]),
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
+ MEDQA: createTooltipContent("Placeholder", [
117
+ {
118
+ label: "Purpose",
119
+ description: "Placeholder",
120
+ subItems: ["Placeholder", "Placeholder"],
121
+ },
122
+ {
123
+ label: "Scoring: Placeholder",
124
+ description: "Placeholder",
125
+ },
126
+ ]),
 
 
 
 
 
 
 
 
 
 
 
127
 
128
+ PUBMEDQA: createTooltipContent("Placeholder", [
129
+ {
130
+ label: "Purpose",
131
+ description: "Placeholder",
132
+ subItems: ["Placeholder", "Placeholder"],
133
+ },
134
+ {
135
+ label: "Scoring: Placeholder",
136
+ description: "Placeholder",
137
+ },
138
+ ]),
 
 
 
 
 
 
 
 
 
139
 
140
+ PUBMED: createTooltipContent("Placeholder", [
141
+ {
142
+ label: "Purpose",
143
+ description: "Placeholder",
144
+ subItems: ["Placeholder", "Placeholder"],
145
+ },
146
+ {
147
+ label: "Scoring: Placeholder",
148
+ description: "Placeholder",
149
+ },
150
+ ]),
151
 
152
+ MS2: createTooltipContent("Placeholder", [
153
+ {
154
+ label: "Purpose",
155
+ description: "Placeholder",
156
+ subItems: ["Placeholder", "Placeholder"],
157
+ },
158
+ {
159
+ label: "Scoring: Placeholder",
160
+ description: "Placeholder",
161
+ },
162
+ ]),
 
163
 
164
+ COCHRANE_PLS: createTooltipContent("Placeholder", [
165
+ {
166
+ label: "Purpose",
167
+ description: "Placeholder",
168
+ subItems: ["Placeholder", "Placeholder"],
169
+ },
170
+ {
171
+ label: "Scoring: Placeholder",
172
+ description: "Placeholder",
173
+ },
174
+ ]),
175
+
176
+ PLOS: createTooltipContent("Placeholder", [
177
+ {
178
+ label: "Purpose",
179
+ description: "Placeholder",
180
+ subItems: ["Placeholder", "Placeholder"],
181
+ },
182
+ {
183
+ label: "Scoring: Placeholder",
184
+ description: "Placeholder",
185
+ },
186
+ ]),
187
+
188
+ ARCHITECTURE: createTooltipContent("Model Architecture Information:", [
189
+ {
190
+ label: "Definition",
191
+ description: "The fundamental structure and design of the model",
192
+ subItems: [
193
+ "Pretrained: Foundational models, initially trained on large datasets without task-specific tuning, serving as a versatile base for further development.",
194
+ "Continuously Pretrained: Base models trained with a data mix evolving as the model is trained, with the addition of specialized data during the last training steps.",
195
+ "Fine-tuned: Base models, fine-tuned on specialised domain data (legal, medical, ...), and optimized for particular tasks.",
196
+ "Chat: Models fine-tuned with IFT, RLHF, DPO, and other techniques, to handle conversational contexts effectively.",
197
+ "Merged: Combining multiple models through weights averaging or similar methods.",
198
+ "Multimodal: Models which can handle several modalities (text & image/audio/video/...). We only evaluate the text capabilities.",
199
+ ],
200
+ },
201
+ {
202
+ label: "Impact",
203
+ description: "How architecture affects model capabilities",
204
+ subItems: [
205
+ "Base models are expected to perform less well on instruction following evaluations, like IFEval.",
206
+ "Fine-tuned and chat models can be more verbose and more chatty than base models.",
207
+ "Merged models tend to exhibit good performance on benchmarks, which do not translate to real-world situations.",
208
+ ],
209
+ },
210
+ ]),
211
+
212
+ PRECISION: createTooltipContent("Numerical Precision Format:", [
213
+ {
214
+ label: "Overview",
215
+ description:
216
+ "Data format used to store model weights and perform computations",
217
+ subItems: [
218
+ "bfloat16: Half precision (Brain Float format), good for stability",
219
+ "float16: Half precision",
220
+ "8bit/4bit: Quantized formats, for efficiency",
221
+ "GPTQ/AWQ: Quantized methods",
222
+ ],
223
+ },
224
+ {
225
+ label: "Impact",
226
+ description: "How precision affects model deployment",
227
+ subItems: [
228
+ "Higher precision = better accuracy but more memory usage",
229
+ "Lower precision = faster inference and smaller size",
230
+ "Trade-off between model quality and resource usage",
231
+ ],
232
+ },
233
+ ]),
234
+
235
+ FLAGS: createTooltipContent("Model Flags and Special Features:", [
236
+ {
237
+ label: "Filters",
238
+ subItems: [
239
+ "Mixture of Expert: Uses a MoE architecture",
240
+ "Merged models: Created by averaging other models",
241
+ "Contaminated: Flagged by users from the community for (possibly accidental) cheating",
242
+ "Unavailable: No longer on the hub (private, deleted) or missing a license tag",
243
+ ],
244
+ },
245
+ {
246
+ label: "Purpose",
247
+ description: "Why do people want to hide these models?",
248
+ subItems: [
249
+ "Mixture of Experts: These models can be too parameter heavy",
250
+ "Merged models: Performance on benchmarks tend to be inflated compared to real life usage",
251
+ "Contaminated: Performance on benchmarks is inflated and not reflecting real life usage",
252
+ ],
253
+ },
254
+ ]),
255
+
256
+ PARAMETERS: createTooltipContent("Model Parameters:", [
257
+ {
258
+ label: "Measurement",
259
+ description: "Total number of trainable parameters in billions",
260
+ subItems: [
261
+ "Indicates model capacity and complexity",
262
+ "Correlates with computational requirements",
263
+ "Influences memory usage and inference speed",
264
+ ],
265
+ },
266
+ ]),
267
+
268
+ LICENSE: createTooltipContent("Model License Information:", [
269
+ {
270
+ label: "Importance",
271
+ description: "Legal terms governing model usage and distribution",
272
+ subItems: [
273
+ "Commercial vs non-commercial use",
274
+ "Attribution requirements",
275
+ "Modification and redistribution rights",
276
+ "Liability and warranty terms",
277
+ ],
278
+ },
279
+ ]),
280
+
281
+ CO2_COST: createTooltipContent("Carbon Dioxide Emissions:", [
282
+ {
283
+ label: "What is it?",
284
+ description: "CO₂ emissions of the model evaluation ",
285
+ subItems: [
286
+ "Only focuses on model inference for our specific setup",
287
+ "Considers data center location and energy mix",
288
+ "Allows equivalent comparision of models on our use case",
289
+ ],
290
+ },
291
+ {
292
+ label: "Why it matters",
293
+ description: "Environmental impact of AI model training",
294
+ subItems: [
295
+ "Large models can have significant carbon footprints",
296
+ "Helps make informed choices about model selection",
297
+ ],
298
+ },
299
+ {
300
+ label: "Learn more",
301
+ description:
302
+ "For detailed information about our CO₂ calculation methodology, visit:",
303
+ subItems: [
304
+ <a
305
+ href="https://huggingface.co/docs/leaderboards/open_llm_leaderboard/emissions"
306
+ target="_blank"
307
+ rel="noopener noreferrer"
308
+ style={{ color: "#90caf9" }}
309
+ >
310
+ Carbon Emissions Documentation ↗
311
+ </a>,
312
+ ],
313
+ },
314
+ ]),
315
  };
316
 
317
  export const UI_TOOLTIPS = {
frontend/src/pages/LeaderboardPage/components/Leaderboard/utils/columnUtils.js CHANGED
@@ -451,614 +451,757 @@ export const createColumns = (
451
  onTogglePin,
452
  hasPinnedRows = false
453
  ) => {
454
- // Ajuster les tailles des colonnes en fonction de la présence de lignes épinglées
455
- const getColumnSize = (defaultSize) =>
456
- hasPinnedRows ? "auto" : `${defaultSize}px`;
457
 
458
- const baseColumns = [
459
- {
460
- accessorKey: "isPinned",
461
- header: () => null,
462
- cell: ({ row }) => (
463
- <Box
464
- sx={{
465
- display: "flex",
466
- alignItems: "center",
467
- justifyContent: "center",
468
- height: "100%",
469
- }}
470
- >
471
- <IconButton
472
- size="small"
473
- onClick={(e) => {
474
- e.stopPropagation();
475
- e.preventDefault();
476
- onTogglePin(row.original.id);
477
- }}
478
- sx={{
479
- padding: 0.5,
480
- color: row.original.isPinned ? "primary.main" : "grey.400",
481
- "&:hover": {
482
- color: "primary.main",
483
- },
484
- }}
485
- >
486
- {row.original.isPinned ? (
487
- <PushPinIcon fontSize="small" />
488
- ) : (
489
- <PushPinOutlinedIcon fontSize="small" />
490
- )}
491
- </IconButton>
492
- </Box>
493
- ),
494
- enableSorting: false,
495
- size: getColumnSize(40),
496
- },
497
- {
498
- accessorKey: "rank",
499
- header: createHeaderCell("Rank"),
500
- cell: ({ row }) => {
501
- const rank =
502
- rankingMode === "static"
503
- ? row.original.static_rank
504
- : row.original.dynamic_rank;
 
 
505
 
506
- return (
507
- <RankIndicator
508
- rank={rank}
509
- previousRank={row.original.previous_rank}
510
- mode="static"
511
- />
512
- );
513
- },
514
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["rank"],
515
- },
516
- {
517
- id: "model_type",
518
- accessorFn: (row) => row.model.type,
519
- header: createHeaderCell("Type"),
520
- sortingFn: typeColumnSort,
521
- cell: ({ row }) => (
522
- <Box
523
- sx={{
524
- display: "flex",
525
- alignItems: "center",
526
- justifyContent: "center",
527
- width: "100%",
528
- }}
529
- >
530
- <Tooltip title={row.original.model.type}>
531
- <Typography
532
- sx={{
533
- fontSize: "1.2rem",
534
- cursor: "help",
535
- lineHeight: 1,
536
- fontFamily:
537
- '"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif',
538
- }}
539
- >
540
- {getModelTypeIcon(row.original.model.type)}
541
- </Typography>
542
- </Tooltip>
543
- </Box>
544
- ),
545
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.type_icon"],
546
- },
547
- {
548
- accessorKey: "id",
549
- header: createModelHeader(totalModels),
550
- cell: ({ row }) => {
551
- const textSearch = extractTextSearch(searchValue);
552
- const modelName = row.original.model.name;
553
 
554
- return (
555
- <Box
556
- sx={{
557
- width: "100%",
558
- display: "flex",
559
- alignItems: "center",
560
- gap: 1,
561
- }}
562
- >
563
- <Box
564
- sx={{
565
- display: "flex",
566
- alignItems: "center",
567
- gap: 1,
568
- minWidth: 0,
569
- flex: 1,
570
- }}
571
- >
572
- <Link
573
- href={`https://huggingface.co/${modelName}`}
574
- target="_blank"
575
- rel="noopener noreferrer"
576
- aria-label={`View ${modelName} on Hugging Face Hub`}
577
- title={TABLE_TOOLTIPS.HUB_LINK(modelName)}
578
- sx={{
579
- textDecoration: "none",
580
- color: "info.main",
581
- display: "flex",
582
- alignItems: "center",
583
- gap: 0.5,
584
- "&:hover": {
585
- textDecoration: "underline",
586
- color: (theme) =>
587
- theme.palette.mode === "dark"
588
- ? theme.palette.info.light
589
- : theme.palette.info.dark,
590
- "& svg": {
591
- opacity: 0.8,
592
- },
593
- },
594
- overflow: "hidden",
595
- textOverflow: "ellipsis",
596
- whiteSpace: "nowrap",
597
- flex: 1,
598
- minWidth: 0,
599
- fontWeight: row.original.static_rank <= 3 ? 600 : "inherit",
600
- }}
601
- >
602
- <HighlightedText text={modelName} searchValue={textSearch} />
603
- <OpenInNewIcon
604
- sx={{
605
- fontSize: "0.75rem",
606
- opacity: 0.6,
607
- transition: "opacity 0.2s ease-in-out",
608
- ml: 0.5,
609
- flexShrink: 0,
610
- }}
611
- />
612
- </Link>
613
- <Link
614
- href={getDetailsUrl(modelName)}
615
- target="_blank"
616
- rel="noopener noreferrer"
617
- aria-label={`View detailed evaluation results for ${modelName}`}
618
- title={TABLE_TOOLTIPS.EVAL_RESULTS(modelName)}
619
- sx={{
620
- textDecoration: "none",
621
- "&:hover": {
622
- textDecoration: "underline",
623
- "& svg": {
624
- color: "text.primary",
625
- },
626
- },
627
- display: "flex",
628
- alignItems: "center",
629
- color: "text.secondary",
630
- flexShrink: 0,
631
- mr: 0,
632
- }}
633
- >
634
- <DatabaseIcon />
635
- </Link>
636
- </Box>
637
- </Box>
638
- );
639
- },
640
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["id"],
641
- },
642
- {
643
- accessorKey: "model.average_score",
644
- header: createHeaderCell("Average", COLUMN_TOOLTIPS.AVERAGE),
645
- cell: ({ row, getValue }) =>
646
- createScoreCell(getValue, row, "model.average_score"),
647
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.average_score"],
648
- meta: {
649
- headerStyle: {
650
- borderLeft: (theme) =>
651
- `2px solid ${alpha(
652
- theme.palette.divider,
653
- theme.palette.mode === "dark" ? 0.1 : 0.2
654
- )}`,
655
- borderRight: (theme) =>
656
- `2px solid ${alpha(
657
- theme.palette.divider,
658
- theme.palette.mode === "dark" ? 0.1 : 0.2
659
- )}`,
660
  },
661
- cellStyle: (value) => ({
662
- position: "relative",
663
- overflow: "hidden",
664
- padding: "8px 16px",
665
- borderLeft: (theme) =>
666
- `2px solid ${alpha(
667
- theme.palette.divider,
668
- theme.palette.mode === "dark" ? 0.1 : 0.2
669
- )}`,
670
- borderRight: (theme) =>
671
- `2px solid ${alpha(
672
- theme.palette.divider,
673
- theme.palette.mode === "dark" ? 0.1 : 0.2
674
- )}`,
675
- }),
676
- },
677
- },
678
- ];
679
- const createScoreCell = (getValue, row, field) => {
680
- const value = getValue();
681
- const rawValue = field.includes("normalized")
682
- ? row.original.evaluations[field.split(".")[1]]?.value
683
- : value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
 
685
- const isAverageColumn = field === "model.average_score";
686
- const hasNoValue = value === null || value === undefined;
687
 
688
- return (
689
- <Box sx={commonStyles.cellContainer}>
690
- {!hasNoValue && (scoreDisplay === "normalized" || isAverageColumn) && (
691
- <Box
692
- sx={{
693
- position: "absolute",
694
- left: -16,
695
- top: -16,
696
- height: "calc(100% + 32px)",
697
- width: `calc(${value}% + 16px)`,
698
- backgroundColor: getColorForValue(value),
699
- opacity: (theme) => (theme.palette.mode === "light" ? 0.1 : 0.2),
700
- transition: "width 0.3s ease",
701
- zIndex: 0,
702
- }}
703
- />
704
- )}
705
- <Box
706
- sx={{
707
- position: "relative",
708
- display: "flex",
709
- alignItems: "center",
710
- gap: 1,
711
- zIndex: 1,
712
- pl: isAverageColumn && !hasNoValue ? 1 : 0,
713
- }}
714
- >
715
- {isAverageColumn && !hasNoValue && (
716
- <Box
717
- sx={{
718
- width: 10,
719
- height: 10,
720
- borderRadius: "50%",
721
- marginLeft: -1,
722
- backgroundColor: getColorForValue(value),
723
- }}
724
- />
725
- )}
726
- <Typography variant="body2">
727
- {hasNoValue ? (
728
- "-"
729
- ) : (
730
- <>
731
- {isAverageColumn ? (
732
- <>
733
- {value.toFixed(2)}
734
- <span style={{ opacity: 0.5 }}> %</span>
735
- </>
736
- ) : scoreDisplay === "normalized" ? (
737
- <>
738
- {value.toFixed(2)}
739
- <span style={{ opacity: 0.5 }}> %</span>
740
- </>
741
- ) : (
742
- <>{rawValue.toFixed(2)}</>
743
- )}
744
- </>
745
- )}
746
- </Typography>
747
- </Box>
748
- </Box>
749
- );
750
- };
 
 
751
 
752
- const evaluationColumns = [
753
- {
754
- accessorKey: "evaluations.multifin.normalized_score",
755
- header: createHeaderCell("MultiFin", COLUMN_TOOLTIPS.MULTIFIN),
756
- cell: ({ row, getValue }) =>
757
- createScoreCell(getValue, row, "evaluations.multifin.normalized_score"),
758
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
759
- "evaluations.multifin.normalized_score"
760
- ],
761
- },
762
- {
763
- accessorKey: "evaluations.qa.normalized_score",
764
- header: createHeaderCell("QA", COLUMN_TOOLTIPS.QA),
765
- cell: ({ row, getValue }) =>
766
- createScoreCell(getValue, row, "evaluations.qa.normalized_score"),
767
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
768
- "evaluations.qa.normalized_score"
769
- ],
770
- },
771
- {
772
- accessorKey: "evaluations.fns.normalized_score",
773
- header: createHeaderCell("FNS", COLUMN_TOOLTIPS.FNS),
774
- cell: ({ row, getValue }) =>
775
- createScoreCell(getValue, row, "evaluations.fns.normalized_score"),
776
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
777
- "evaluations.fns.normalized_score"
778
- ],
779
- },
780
- {
781
- accessorKey: "evaluations.finnum.normalized_score",
782
- header: createHeaderCell("FinNum", COLUMN_TOOLTIPS.FinNum),
783
- cell: ({ row, getValue }) =>
784
- createScoreCell(getValue, row, "evaluations.finnum.normalized_score"),
785
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
786
- "evaluations.finnum.normalized_score"
787
- ],
788
- },
789
- {
790
- accessorKey: "evaluations.fintext.normalized_score",
791
- header: createHeaderCell("FinText", COLUMN_TOOLTIPS.FinText),
792
- cell: ({ row, getValue }) =>
793
- createScoreCell(getValue, row, "evaluations.fintext.normalized_score"),
794
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
795
- "evaluations.fintext.normalized_score"
796
- ],
797
- },
798
- ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799
 
800
- const optionalColumns = [
801
- {
802
- accessorKey: "model.architecture",
803
- header: createHeaderCell("Architecture", COLUMN_TOOLTIPS.ARCHITECTURE),
804
- accessorFn: (row) => row.model.architecture,
805
- cell: ({ row }) => (
806
- <Tooltip title={row.original.model.architecture || "-"}>
807
- <span>{row.original.model.architecture || "-"}</span>
808
- </Tooltip>
809
- ),
810
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.architecture"],
811
- },
812
- {
813
- accessorKey: "model.precision",
814
- header: createHeaderCell("Precision", COLUMN_TOOLTIPS.PRECISION),
815
- accessorFn: (row) => row.model.precision,
816
- cell: ({ row }) => (
817
- <Tooltip title={row.original.model.precision || "-"}>
818
- <span>{row.original.model.precision || "-"}</span>
819
- </Tooltip>
820
- ),
821
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.precision"],
822
- },
823
- {
824
- accessorKey: "metadata.params_billions",
825
- header: createHeaderCell("Parameters", COLUMN_TOOLTIPS.PARAMETERS),
826
- cell: ({ row }) => (
827
- <Box
828
- sx={{
829
- display: "flex",
830
- alignItems: "center",
831
- justifyContent: "flex-start",
832
- }}
833
- >
834
- <Typography variant="body2">
835
- {row.original.metadata.params_billions}
836
- <span style={{ opacity: 0.6 }}>B</span>
837
- </Typography>
838
- </Box>
839
- ),
840
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.params_billions"],
841
- },
842
- {
843
- accessorKey: "metadata.hub_license",
844
- header: createHeaderCell("License", COLUMN_TOOLTIPS.LICENSE),
845
- cell: ({ row }) => (
846
- <Tooltip title={row.original.metadata.hub_license || "-"}>
847
- <Typography
848
- variant="body2"
849
- sx={{
850
- overflow: "hidden",
851
- textOverflow: "ellipsis",
852
- whiteSpace: "nowrap",
853
- }}
854
- >
855
- {row.original.metadata.hub_license || "-"}
856
- </Typography>
857
- </Tooltip>
858
- ),
859
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.hub_license"],
860
- },
861
- {
862
- accessorKey: "metadata.hub_hearts",
863
- header: createHeaderCell(
864
- "Hub ❤️",
865
- "Number of likes received on the Hugging Face Hub"
866
- ),
867
- cell: ({ row }) => (
868
- <Typography variant="body2">
869
- {row.original.metadata.hub_hearts}
870
- </Typography>
871
- ),
872
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.hub_hearts"],
873
- },
874
- {
875
- accessorKey: "metadata.upload_date",
876
- header: createHeaderCell(
877
- "Upload Date",
878
- "Date when the model was uploaded to the Hugging Face Hub"
879
- ),
880
- cell: ({ row }) => (
881
- <Tooltip title={row.original.metadata.upload_date || "-"}>
882
- <Typography
883
- variant="body2"
884
- sx={{
885
- overflow: "hidden",
886
- textOverflow: "ellipsis",
887
- whiteSpace: "nowrap",
888
- }}
889
- >
890
- {row.original.metadata.upload_date || "-"}
891
- </Typography>
892
- </Tooltip>
893
- ),
894
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.upload_date"],
895
- },
896
- {
897
- accessorKey: "metadata.submission_date",
898
- header: createHeaderCell(
899
- "Submission Date",
900
- "Date when the model was submitted to the leaderboard"
901
- ),
902
- cell: ({ row }) => (
903
- <Tooltip title={row.original.metadata.submission_date || "-"}>
904
- <Typography
905
- variant="body2"
906
- sx={{
907
- overflow: "hidden",
908
- textOverflow: "ellipsis",
909
- whiteSpace: "nowrap",
910
- }}
911
- >
912
- {row.original.metadata.submission_date || "-"}
913
- </Typography>
914
- </Tooltip>
915
- ),
916
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.submission_date"],
917
- },
918
- {
919
- accessorKey: "metadata.generation",
920
- header: createHeaderCell(
921
- "Generation",
922
- "The generation or version number of the model"
923
- ),
924
- cell: ({ row }) => (
925
- <Typography variant="body2">
926
- {row.original.metadata.generation}
927
- </Typography>
928
- ),
929
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.generation"],
930
- },
931
- {
932
- accessorKey: "metadata.base_model",
933
- header: createHeaderCell(
934
- "Base Model",
935
- "The original model this model was derived from"
936
- ),
937
- cell: ({ row }) => (
938
- <Tooltip title={row.original.metadata.base_model || "-"}>
939
- <Typography
940
- variant="body2"
941
- sx={{
942
- overflow: "hidden",
943
- textOverflow: "ellipsis",
944
- whiteSpace: "nowrap",
945
- }}
946
- >
947
- {row.original.metadata.base_model || "-"}
948
- </Typography>
949
- </Tooltip>
950
- ),
951
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.base_model"],
952
- },
953
- {
954
- accessorKey: "metadata.co2_cost",
955
- header: createHeaderCell("CO₂ Cost", COLUMN_TOOLTIPS.CO2_COST),
956
- cell: ({ row }) => (
957
- <Box
958
- sx={{
959
- display: "flex",
960
- alignItems: "center",
961
- justifyContent: "flex-start",
962
- }}
963
- >
964
- <Typography variant="body2">
965
- {row.original.metadata.co2_cost?.toFixed(2) || "0"}
966
- <span style={{ opacity: 0.6 }}> kg</span>
967
- </Typography>
968
- </Box>
969
- ),
970
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.co2_cost"],
971
- },
972
- {
973
- accessorKey: "model.has_chat_template",
974
- header: createHeaderCell(
975
- "Chat Template",
976
- "Whether this model has a chat template defined"
977
- ),
978
- cell: ({ row }) => (
979
- <BooleanValue value={row.original.model.has_chat_template} />
980
- ),
981
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.has_chat_template"],
982
- },
983
- {
984
- accessorKey: "features.is_not_available_on_hub",
985
- header: createHeaderCell(
986
- "Hub Availability",
987
- "Whether the model is available on the Hugging Face Hub"
988
- ),
989
- cell: ({ row }) => (
990
- <BooleanValue value={row.original.features.is_not_available_on_hub} />
991
- ),
992
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
993
- "features.is_not_available_on_hub"
994
- ],
995
- },
996
- {
997
- accessorKey: "features.is_highlighted_by_maintainer",
998
- header: createHeaderCell(
999
- "Official Providers",
1000
- "Models that are officially provided and maintained by their original creators or organizations"
1001
- ),
1002
- cell: ({ row }) => (
1003
- <BooleanValue
1004
- value={row.original.features.is_highlighted_by_maintainer}
1005
- />
1006
- ),
1007
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
1008
- "features.is_highlighted_by_maintainer"
1009
- ],
1010
- enableSorting: true,
1011
- },
1012
- {
1013
- accessorKey: "features.is_moe",
1014
- header: createHeaderCell(
1015
- "Mixture of Experts",
1016
- "Whether this model uses a Mixture of Experts architecture"
1017
- ),
1018
- cell: ({ row }) => <BooleanValue value={row.original.features.is_moe} />,
1019
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["features.is_moe"],
1020
- },
1021
- {
1022
- accessorKey: "features.is_flagged",
1023
- header: createHeaderCell(
1024
- "Flag Status",
1025
- "Whether this model has been flagged for any issues"
1026
- ),
1027
- cell: ({ row }) => (
1028
- <BooleanValue value={row.original.features.is_flagged} />
1029
- ),
1030
- size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["features.is_flagged"],
1031
- },
1032
- ];
 
 
 
 
 
 
 
 
 
 
 
 
 
1033
 
1034
- // Utiliser directement columnVisibility
1035
- const finalColumns = [
1036
- ...baseColumns,
1037
- ...evaluationColumns.filter((col) => columnVisibility[col.accessorKey]),
1038
- ...optionalColumns
1039
- .filter((col) => columnVisibility[col.accessorKey])
1040
- .sort((a, b) => {
1041
- // Définir l'ordre personnalisé des colonnes
1042
- const order = {
1043
- "model.architecture": 1,
1044
- "model.precision": 2,
1045
- "metadata.params_billions": 3,
1046
- "metadata.hub_license": 4,
1047
- "metadata.co2_cost": 5,
1048
- "metadata.hub_hearts": 6,
1049
- "metadata.upload_date": 7,
1050
- "metadata.submission_date": 8,
1051
- "metadata.generation": 9,
1052
- "metadata.base_model": 10,
1053
- "model.has_chat_template": 11,
1054
- "features.is_not_available_on_hub": 12,
1055
- "features.is_highlighted_by_maintainer": 13,
1056
- "features.is_moe": 14,
1057
- "features.is_flagged": 15,
1058
- };
1059
- return order[a.accessorKey] - order[b.accessorKey];
1060
- }),
1061
- ];
1062
 
1063
- return finalColumns;
1064
  };
 
451
  onTogglePin,
452
  hasPinnedRows = false
453
  ) => {
454
+ // Ajuster les tailles des colonnes en fonction de la présence de lignes épinglées
455
+ const getColumnSize = (defaultSize) =>
456
+ hasPinnedRows ? "auto" : `${defaultSize}px`;
457
 
458
+ const baseColumns = [
459
+ {
460
+ accessorKey: "isPinned",
461
+ header: () => null,
462
+ cell: ({ row }) => (
463
+ <Box
464
+ sx={{
465
+ display: "flex",
466
+ alignItems: "center",
467
+ justifyContent: "center",
468
+ height: "100%",
469
+ }}
470
+ >
471
+ <IconButton
472
+ size="small"
473
+ onClick={(e) => {
474
+ e.stopPropagation();
475
+ e.preventDefault();
476
+ onTogglePin(row.original.id);
477
+ }}
478
+ sx={{
479
+ padding: 0.5,
480
+ color: row.original.isPinned
481
+ ? "primary.main"
482
+ : "grey.400",
483
+ "&:hover": {
484
+ color: "primary.main",
485
+ },
486
+ }}
487
+ >
488
+ {row.original.isPinned ? (
489
+ <PushPinIcon fontSize="small" />
490
+ ) : (
491
+ <PushPinOutlinedIcon fontSize="small" />
492
+ )}
493
+ </IconButton>
494
+ </Box>
495
+ ),
496
+ enableSorting: false,
497
+ size: getColumnSize(40),
498
+ },
499
+ {
500
+ accessorKey: "rank",
501
+ header: createHeaderCell("Rank"),
502
+ cell: ({ row }) => {
503
+ const rank =
504
+ rankingMode === "static"
505
+ ? row.original.static_rank
506
+ : row.original.dynamic_rank;
507
 
508
+ return (
509
+ <RankIndicator
510
+ rank={rank}
511
+ previousRank={row.original.previous_rank}
512
+ mode="static"
513
+ />
514
+ );
515
+ },
516
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["rank"],
517
+ },
518
+ {
519
+ id: "model_type",
520
+ accessorFn: (row) => row.model.type,
521
+ header: createHeaderCell("Type"),
522
+ sortingFn: typeColumnSort,
523
+ cell: ({ row }) => (
524
+ <Box
525
+ sx={{
526
+ display: "flex",
527
+ alignItems: "center",
528
+ justifyContent: "center",
529
+ width: "100%",
530
+ }}
531
+ >
532
+ <Tooltip title={row.original.model.type}>
533
+ <Typography
534
+ sx={{
535
+ fontSize: "1.2rem",
536
+ cursor: "help",
537
+ lineHeight: 1,
538
+ fontFamily:
539
+ '"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif',
540
+ }}
541
+ >
542
+ {getModelTypeIcon(row.original.model.type)}
543
+ </Typography>
544
+ </Tooltip>
545
+ </Box>
546
+ ),
547
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.type_icon"],
548
+ },
549
+ {
550
+ accessorKey: "id",
551
+ header: createModelHeader(totalModels),
552
+ cell: ({ row }) => {
553
+ const textSearch = extractTextSearch(searchValue);
554
+ const modelName = row.original.model.name;
555
 
556
+ return (
557
+ <Box
558
+ sx={{
559
+ width: "100%",
560
+ display: "flex",
561
+ alignItems: "center",
562
+ gap: 1,
563
+ }}
564
+ >
565
+ <Box
566
+ sx={{
567
+ display: "flex",
568
+ alignItems: "center",
569
+ gap: 1,
570
+ minWidth: 0,
571
+ flex: 1,
572
+ }}
573
+ >
574
+ <Link
575
+ href={`https://huggingface.co/${modelName}`}
576
+ target="_blank"
577
+ rel="noopener noreferrer"
578
+ aria-label={`View ${modelName} on Hugging Face Hub`}
579
+ title={TABLE_TOOLTIPS.HUB_LINK(modelName)}
580
+ sx={{
581
+ textDecoration: "none",
582
+ color: "info.main",
583
+ display: "flex",
584
+ alignItems: "center",
585
+ gap: 0.5,
586
+ "&:hover": {
587
+ textDecoration: "underline",
588
+ color: (theme) =>
589
+ theme.palette.mode === "dark"
590
+ ? theme.palette.info.light
591
+ : theme.palette.info.dark,
592
+ "& svg": {
593
+ opacity: 0.8,
594
+ },
595
+ },
596
+ overflow: "hidden",
597
+ textOverflow: "ellipsis",
598
+ whiteSpace: "nowrap",
599
+ flex: 1,
600
+ minWidth: 0,
601
+ fontWeight:
602
+ row.original.static_rank <= 3
603
+ ? 600
604
+ : "inherit",
605
+ }}
606
+ >
607
+ <HighlightedText
608
+ text={modelName}
609
+ searchValue={textSearch}
610
+ />
611
+ <OpenInNewIcon
612
+ sx={{
613
+ fontSize: "0.75rem",
614
+ opacity: 0.6,
615
+ transition: "opacity 0.2s ease-in-out",
616
+ ml: 0.5,
617
+ flexShrink: 0,
618
+ }}
619
+ />
620
+ </Link>
621
+ <Link
622
+ href={getDetailsUrl(modelName)}
623
+ target="_blank"
624
+ rel="noopener noreferrer"
625
+ aria-label={`View detailed evaluation results for ${modelName}`}
626
+ title={TABLE_TOOLTIPS.EVAL_RESULTS(modelName)}
627
+ sx={{
628
+ textDecoration: "none",
629
+ "&:hover": {
630
+ textDecoration: "underline",
631
+ "& svg": {
632
+ color: "text.primary",
633
+ },
634
+ },
635
+ display: "flex",
636
+ alignItems: "center",
637
+ color: "text.secondary",
638
+ flexShrink: 0,
639
+ mr: 0,
640
+ }}
641
+ >
642
+ <DatabaseIcon />
643
+ </Link>
644
+ </Box>
645
+ </Box>
646
+ );
647
+ },
648
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["id"],
 
 
 
 
 
 
 
 
 
 
 
 
 
649
  },
650
+ {
651
+ accessorKey: "model.average_score",
652
+ header: createHeaderCell("Average", COLUMN_TOOLTIPS.AVERAGE),
653
+ cell: ({ row, getValue }) =>
654
+ createScoreCell(getValue, row, "model.average_score"),
655
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.average_score"],
656
+ meta: {
657
+ headerStyle: {
658
+ borderLeft: (theme) =>
659
+ `2px solid ${alpha(
660
+ theme.palette.divider,
661
+ theme.palette.mode === "dark" ? 0.1 : 0.2
662
+ )}`,
663
+ borderRight: (theme) =>
664
+ `2px solid ${alpha(
665
+ theme.palette.divider,
666
+ theme.palette.mode === "dark" ? 0.1 : 0.2
667
+ )}`,
668
+ },
669
+ cellStyle: (value) => ({
670
+ position: "relative",
671
+ overflow: "hidden",
672
+ padding: "8px 16px",
673
+ borderLeft: (theme) =>
674
+ `2px solid ${alpha(
675
+ theme.palette.divider,
676
+ theme.palette.mode === "dark" ? 0.1 : 0.2
677
+ )}`,
678
+ borderRight: (theme) =>
679
+ `2px solid ${alpha(
680
+ theme.palette.divider,
681
+ theme.palette.mode === "dark" ? 0.1 : 0.2
682
+ )}`,
683
+ }),
684
+ },
685
+ },
686
+ ];
687
+ const createScoreCell = (getValue, row, field) => {
688
+ const value = getValue();
689
+ const rawValue = field.includes("normalized")
690
+ ? row.original.evaluations[field.split(".")[1]]?.value
691
+ : value;
692
 
693
+ const isAverageColumn = field === "model.average_score";
694
+ const hasNoValue = value === null || value === undefined;
695
 
696
+ return (
697
+ <Box sx={commonStyles.cellContainer}>
698
+ {!hasNoValue &&
699
+ (scoreDisplay === "normalized" || isAverageColumn) && (
700
+ <Box
701
+ sx={{
702
+ position: "absolute",
703
+ left: -16,
704
+ top: -16,
705
+ height: "calc(100% + 32px)",
706
+ width: `calc(${value}% + 16px)`,
707
+ backgroundColor: getColorForValue(value),
708
+ opacity: (theme) =>
709
+ theme.palette.mode === "light" ? 0.1 : 0.2,
710
+ transition: "width 0.3s ease",
711
+ zIndex: 0,
712
+ }}
713
+ />
714
+ )}
715
+ <Box
716
+ sx={{
717
+ position: "relative",
718
+ display: "flex",
719
+ alignItems: "center",
720
+ gap: 1,
721
+ zIndex: 1,
722
+ pl: isAverageColumn && !hasNoValue ? 1 : 0,
723
+ }}
724
+ >
725
+ {isAverageColumn && !hasNoValue && (
726
+ <Box
727
+ sx={{
728
+ width: 10,
729
+ height: 10,
730
+ borderRadius: "50%",
731
+ marginLeft: -1,
732
+ backgroundColor: getColorForValue(value),
733
+ }}
734
+ />
735
+ )}
736
+ <Typography variant="body2">
737
+ {hasNoValue ? (
738
+ "-"
739
+ ) : (
740
+ <>
741
+ {isAverageColumn ? (
742
+ <>
743
+ {value.toFixed(2)}
744
+ <span style={{ opacity: 0.5 }}> %</span>
745
+ </>
746
+ ) : scoreDisplay === "normalized" ? (
747
+ <>
748
+ {value.toFixed(2)}
749
+ <span style={{ opacity: 0.5 }}> %</span>
750
+ </>
751
+ ) : (
752
+ <>{rawValue.toFixed(2)}</>
753
+ )}
754
+ </>
755
+ )}
756
+ </Typography>
757
+ </Box>
758
+ </Box>
759
+ );
760
+ };
761
 
762
+ const evaluationColumns = [
763
+ {
764
+ accessorKey: "evaluations.bc5cdr_chemical.normalized_score",
765
+ header: createHeaderCell(
766
+ "BC5CDR-chemical",
767
+ COLUMN_TOOLTIPS.BC5CDR_CHEMICAL
768
+ ),
769
+ cell: ({ row, getValue }) =>
770
+ createScoreCell(
771
+ getValue,
772
+ row,
773
+ "evaluations.bc5cdr_chemical.normalized_score"
774
+ ),
775
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
776
+ "evaluations.bc5cdr_chemical.normalized_score"
777
+ ],
778
+ },
779
+ {
780
+ accessorKey: "evaluations.ncbi_disease.normalized_score",
781
+ header: createHeaderCell(
782
+ "NCBI Disease",
783
+ COLUMN_TOOLTIPS.NCBI_DISEASE
784
+ ),
785
+ cell: ({ row, getValue }) =>
786
+ createScoreCell(
787
+ getValue,
788
+ row,
789
+ "evaluations.ncbi_disease.normalized_score"
790
+ ),
791
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
792
+ "evaluations.ncbi_disease.normalized_score"
793
+ ],
794
+ },
795
+ {
796
+ accessorKey: "evaluations.chemprot.normalized_score",
797
+ header: createHeaderCell("ChemProt", COLUMN_TOOLTIPS.CHEMPROT),
798
+ cell: ({ row, getValue }) =>
799
+ createScoreCell(
800
+ getValue,
801
+ row,
802
+ "evaluations.chemprot.normalized_score"
803
+ ),
804
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
805
+ "evaluations.chemprot.normalized_score"
806
+ ],
807
+ },
808
+ {
809
+ accessorKey: "evaluations.ddi2013.normalized_score",
810
+ header: createHeaderCell("DDI2013", COLUMN_TOOLTIPS.DDI2013),
811
+ cell: ({ row, getValue }) =>
812
+ createScoreCell(
813
+ getValue,
814
+ row,
815
+ "evaluations.ddi2013.normalized_score"
816
+ ),
817
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
818
+ "evaluations.ddi2013.normalized_score"
819
+ ],
820
+ },
821
+ {
822
+ accessorKey: "evaluations.hoc.normalized_score",
823
+ header: createHeaderCell("HoC", COLUMN_TOOLTIPS.HOC),
824
+ cell: ({ row, getValue }) =>
825
+ createScoreCell(
826
+ getValue,
827
+ row,
828
+ "evaluations.hoc.normalized_score"
829
+ ),
830
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
831
+ "evaluations.hoc.normalized_score"
832
+ ],
833
+ },
834
+ {
835
+ accessorKey: "evaluations.litcovid.normalized_score",
836
+ header: createHeaderCell("LitCovid", COLUMN_TOOLTIPS.LITCOVID),
837
+ cell: ({ row, getValue }) =>
838
+ createScoreCell(
839
+ getValue,
840
+ row,
841
+ "evaluations.litcovid.normalized_score"
842
+ ),
843
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
844
+ "evaluations.litcovid.normalized_score"
845
+ ],
846
+ },
847
+ {
848
+ accessorKey: "evaluations.medqa.normalized_score",
849
+ header: createHeaderCell("MedQA (5-Option)", COLUMN_TOOLTIPS.MEDQA),
850
+ cell: ({ row, getValue }) =>
851
+ createScoreCell(
852
+ getValue,
853
+ row,
854
+ "evaluations.medqa.normalized_score"
855
+ ),
856
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
857
+ "evaluations.medqa.normalized_score"
858
+ ],
859
+ },
860
+ {
861
+ accessorKey: "evaluations.pubmedqa.normalized_score",
862
+ header: createHeaderCell("PubMedQA", COLUMN_TOOLTIPS.PUBMEDQA),
863
+ cell: ({ row, getValue }) =>
864
+ createScoreCell(
865
+ getValue,
866
+ row,
867
+ "evaluations.pubmedqa.normalized_score"
868
+ ),
869
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
870
+ "evaluations.pubmedqa.normalized_score"
871
+ ],
872
+ },
873
+ {
874
+ accessorKey: "evaluations.pubmed.normalized_score",
875
+ header: createHeaderCell("PubMed", COLUMN_TOOLTIPS.PUBMED),
876
+ cell: ({ row, getValue }) =>
877
+ createScoreCell(
878
+ getValue,
879
+ row,
880
+ "evaluations.pubmed.normalized_score"
881
+ ),
882
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
883
+ "evaluations.pubmed.normalized_score"
884
+ ],
885
+ },
886
+ {
887
+ accessorKey: "evaluations.ms2.normalized_score",
888
+ header: createHeaderCell("MS^2", COLUMN_TOOLTIPS.MS2),
889
+ cell: ({ row, getValue }) =>
890
+ createScoreCell(
891
+ getValue,
892
+ row,
893
+ "evaluations.ms2.normalized_score"
894
+ ),
895
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
896
+ "evaluations.ms2.normalized_score"
897
+ ],
898
+ },
899
+ {
900
+ accessorKey: "evaluations.cochrane_pls.normalized_score",
901
+ header: createHeaderCell(
902
+ "Cochrane PLS",
903
+ COLUMN_TOOLTIPS.COCHRANE_PLS
904
+ ),
905
+ cell: ({ row, getValue }) =>
906
+ createScoreCell(
907
+ getValue,
908
+ row,
909
+ "evaluations.cochrane_pls.normalized_score"
910
+ ),
911
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
912
+ "evaluations.cochrane_pls.normalized_score"
913
+ ],
914
+ },
915
+ {
916
+ accessorKey: "evaluations.plos.normalized_score",
917
+ header: createHeaderCell("PLOS", COLUMN_TOOLTIPS.PLOS),
918
+ cell: ({ row, getValue }) =>
919
+ createScoreCell(
920
+ getValue,
921
+ row,
922
+ "evaluations.plos.normalized_score"
923
+ ),
924
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
925
+ "evaluations.plos.normalized_score"
926
+ ],
927
+ },
928
+ ];
929
 
930
+ const optionalColumns = [
931
+ {
932
+ accessorKey: "model.architecture",
933
+ header: createHeaderCell(
934
+ "Architecture",
935
+ COLUMN_TOOLTIPS.ARCHITECTURE
936
+ ),
937
+ accessorFn: (row) => row.model.architecture,
938
+ cell: ({ row }) => (
939
+ <Tooltip title={row.original.model.architecture || "-"}>
940
+ <span>{row.original.model.architecture || "-"}</span>
941
+ </Tooltip>
942
+ ),
943
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.architecture"],
944
+ },
945
+ {
946
+ accessorKey: "model.precision",
947
+ header: createHeaderCell("Precision", COLUMN_TOOLTIPS.PRECISION),
948
+ accessorFn: (row) => row.model.precision,
949
+ cell: ({ row }) => (
950
+ <Tooltip title={row.original.model.precision || "-"}>
951
+ <span>{row.original.model.precision || "-"}</span>
952
+ </Tooltip>
953
+ ),
954
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["model.precision"],
955
+ },
956
+ {
957
+ accessorKey: "metadata.params_billions",
958
+ header: createHeaderCell("Parameters", COLUMN_TOOLTIPS.PARAMETERS),
959
+ cell: ({ row }) => (
960
+ <Box
961
+ sx={{
962
+ display: "flex",
963
+ alignItems: "center",
964
+ justifyContent: "flex-start",
965
+ }}
966
+ >
967
+ <Typography variant="body2">
968
+ {row.original.metadata.params_billions}
969
+ <span style={{ opacity: 0.6 }}>B</span>
970
+ </Typography>
971
+ </Box>
972
+ ),
973
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
974
+ "metadata.params_billions"
975
+ ],
976
+ },
977
+ {
978
+ accessorKey: "metadata.hub_license",
979
+ header: createHeaderCell("License", COLUMN_TOOLTIPS.LICENSE),
980
+ cell: ({ row }) => (
981
+ <Tooltip title={row.original.metadata.hub_license || "-"}>
982
+ <Typography
983
+ variant="body2"
984
+ sx={{
985
+ overflow: "hidden",
986
+ textOverflow: "ellipsis",
987
+ whiteSpace: "nowrap",
988
+ }}
989
+ >
990
+ {row.original.metadata.hub_license || "-"}
991
+ </Typography>
992
+ </Tooltip>
993
+ ),
994
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.hub_license"],
995
+ },
996
+ {
997
+ accessorKey: "metadata.hub_hearts",
998
+ header: createHeaderCell(
999
+ "Hub ❤️",
1000
+ "Number of likes received on the Hugging Face Hub"
1001
+ ),
1002
+ cell: ({ row }) => (
1003
+ <Typography variant="body2">
1004
+ {row.original.metadata.hub_hearts}
1005
+ </Typography>
1006
+ ),
1007
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.hub_hearts"],
1008
+ },
1009
+ {
1010
+ accessorKey: "metadata.upload_date",
1011
+ header: createHeaderCell(
1012
+ "Upload Date",
1013
+ "Date when the model was uploaded to the Hugging Face Hub"
1014
+ ),
1015
+ cell: ({ row }) => (
1016
+ <Tooltip title={row.original.metadata.upload_date || "-"}>
1017
+ <Typography
1018
+ variant="body2"
1019
+ sx={{
1020
+ overflow: "hidden",
1021
+ textOverflow: "ellipsis",
1022
+ whiteSpace: "nowrap",
1023
+ }}
1024
+ >
1025
+ {row.original.metadata.upload_date || "-"}
1026
+ </Typography>
1027
+ </Tooltip>
1028
+ ),
1029
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.upload_date"],
1030
+ },
1031
+ {
1032
+ accessorKey: "metadata.submission_date",
1033
+ header: createHeaderCell(
1034
+ "Submission Date",
1035
+ "Date when the model was submitted to the leaderboard"
1036
+ ),
1037
+ cell: ({ row }) => (
1038
+ <Tooltip title={row.original.metadata.submission_date || "-"}>
1039
+ <Typography
1040
+ variant="body2"
1041
+ sx={{
1042
+ overflow: "hidden",
1043
+ textOverflow: "ellipsis",
1044
+ whiteSpace: "nowrap",
1045
+ }}
1046
+ >
1047
+ {row.original.metadata.submission_date || "-"}
1048
+ </Typography>
1049
+ </Tooltip>
1050
+ ),
1051
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
1052
+ "metadata.submission_date"
1053
+ ],
1054
+ },
1055
+ {
1056
+ accessorKey: "metadata.generation",
1057
+ header: createHeaderCell(
1058
+ "Generation",
1059
+ "The generation or version number of the model"
1060
+ ),
1061
+ cell: ({ row }) => (
1062
+ <Typography variant="body2">
1063
+ {row.original.metadata.generation}
1064
+ </Typography>
1065
+ ),
1066
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.generation"],
1067
+ },
1068
+ {
1069
+ accessorKey: "metadata.base_model",
1070
+ header: createHeaderCell(
1071
+ "Base Model",
1072
+ "The original model this model was derived from"
1073
+ ),
1074
+ cell: ({ row }) => (
1075
+ <Tooltip title={row.original.metadata.base_model || "-"}>
1076
+ <Typography
1077
+ variant="body2"
1078
+ sx={{
1079
+ overflow: "hidden",
1080
+ textOverflow: "ellipsis",
1081
+ whiteSpace: "nowrap",
1082
+ }}
1083
+ >
1084
+ {row.original.metadata.base_model || "-"}
1085
+ </Typography>
1086
+ </Tooltip>
1087
+ ),
1088
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.base_model"],
1089
+ },
1090
+ {
1091
+ accessorKey: "metadata.co2_cost",
1092
+ header: createHeaderCell("CO₂ Cost", COLUMN_TOOLTIPS.CO2_COST),
1093
+ cell: ({ row }) => (
1094
+ <Box
1095
+ sx={{
1096
+ display: "flex",
1097
+ alignItems: "center",
1098
+ justifyContent: "flex-start",
1099
+ }}
1100
+ >
1101
+ <Typography variant="body2">
1102
+ {row.original.metadata.co2_cost?.toFixed(2) || "0"}
1103
+ <span style={{ opacity: 0.6 }}> kg</span>
1104
+ </Typography>
1105
+ </Box>
1106
+ ),
1107
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["metadata.co2_cost"],
1108
+ },
1109
+ {
1110
+ accessorKey: "model.has_chat_template",
1111
+ header: createHeaderCell(
1112
+ "Chat Template",
1113
+ "Whether this model has a chat template defined"
1114
+ ),
1115
+ cell: ({ row }) => (
1116
+ <BooleanValue value={row.original.model.has_chat_template} />
1117
+ ),
1118
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
1119
+ "model.has_chat_template"
1120
+ ],
1121
+ },
1122
+ {
1123
+ accessorKey: "features.is_not_available_on_hub",
1124
+ header: createHeaderCell(
1125
+ "Hub Availability",
1126
+ "Whether the model is available on the Hugging Face Hub"
1127
+ ),
1128
+ cell: ({ row }) => (
1129
+ <BooleanValue
1130
+ value={row.original.features.is_not_available_on_hub}
1131
+ />
1132
+ ),
1133
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
1134
+ "features.is_not_available_on_hub"
1135
+ ],
1136
+ },
1137
+ {
1138
+ accessorKey: "features.is_highlighted_by_maintainer",
1139
+ header: createHeaderCell(
1140
+ "Official Providers",
1141
+ "Models that are officially provided and maintained by their original creators or organizations"
1142
+ ),
1143
+ cell: ({ row }) => (
1144
+ <BooleanValue
1145
+ value={row.original.features.is_highlighted_by_maintainer}
1146
+ />
1147
+ ),
1148
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES[
1149
+ "features.is_highlighted_by_maintainer"
1150
+ ],
1151
+ enableSorting: true,
1152
+ },
1153
+ {
1154
+ accessorKey: "features.is_moe",
1155
+ header: createHeaderCell(
1156
+ "Mixture of Experts",
1157
+ "Whether this model uses a Mixture of Experts architecture"
1158
+ ),
1159
+ cell: ({ row }) => (
1160
+ <BooleanValue value={row.original.features.is_moe} />
1161
+ ),
1162
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["features.is_moe"],
1163
+ },
1164
+ {
1165
+ accessorKey: "features.is_flagged",
1166
+ header: createHeaderCell(
1167
+ "Flag Status",
1168
+ "Whether this model has been flagged for any issues"
1169
+ ),
1170
+ cell: ({ row }) => (
1171
+ <BooleanValue value={row.original.features.is_flagged} />
1172
+ ),
1173
+ size: TABLE_DEFAULTS.COLUMNS.COLUMN_SIZES["features.is_flagged"],
1174
+ },
1175
+ ];
1176
 
1177
+ // Utiliser directement columnVisibility
1178
+ const finalColumns = [
1179
+ ...baseColumns,
1180
+ ...evaluationColumns.filter((col) => columnVisibility[col.accessorKey]),
1181
+ ...optionalColumns
1182
+ .filter((col) => columnVisibility[col.accessorKey])
1183
+ .sort((a, b) => {
1184
+ // Définir l'ordre personnalisé des colonnes
1185
+ const order = {
1186
+ "model.architecture": 1,
1187
+ "model.precision": 2,
1188
+ "metadata.params_billions": 3,
1189
+ "metadata.hub_license": 4,
1190
+ "metadata.co2_cost": 5,
1191
+ "metadata.hub_hearts": 6,
1192
+ "metadata.upload_date": 7,
1193
+ "metadata.submission_date": 8,
1194
+ "metadata.generation": 9,
1195
+ "metadata.base_model": 10,
1196
+ "model.has_chat_template": 11,
1197
+ "features.is_not_available_on_hub": 12,
1198
+ "features.is_highlighted_by_maintainer": 13,
1199
+ "features.is_moe": 14,
1200
+ "features.is_flagged": 15,
1201
+ };
1202
+ return order[a.accessorKey] - order[b.accessorKey];
1203
+ }),
1204
+ ];
1205
 
1206
+ return finalColumns;
1207
  };