idolezal commited on
Commit
c6d7faa
β€’
1 Parent(s): 690c597

For CSV export added "n-shot" attribute

Browse files
Files changed (1) hide show
  1. server.py +10 -1
server.py CHANGED
@@ -327,7 +327,11 @@ class LeaderboardServer:
327
  submission_ids.add(submission_id)
328
  submission_id_to_file[submission_id] = submission_file
329
  submission_id_to_model_title[submission_id] = metadata["team_name"] + "/" + metadata["model_name"]
330
- submission_id_to_data[submission_id] = {"results": data["results"], "submission_metadata": metadata}
 
 
 
 
331
 
332
  with self.var_lock.rw:
333
  self.submission_ids = submission_ids
@@ -601,6 +605,10 @@ class LeaderboardServer:
601
  model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
602
  local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
603
 
 
 
 
 
604
  release = data["submission_metadata"].get("submission_timestamp")
605
  release = time.strftime("%Y-%m-%d", time.gmtime(release)) if release else "N/A"
606
  local_results["release"] = release
@@ -632,6 +640,7 @@ class LeaderboardServer:
632
  "release",
633
  "model_type",
634
  "parameters",
 
635
  "average_score",
636
  ]
637
  df_order = [
 
327
  submission_ids.add(submission_id)
328
  submission_id_to_file[submission_id] = submission_file
329
  submission_id_to_model_title[submission_id] = metadata["team_name"] + "/" + metadata["model_name"]
330
+ submission_id_to_data[submission_id] = {
331
+ "results": data["results"],
332
+ "metadata": data.get("metadata", {}),
333
+ "submission_metadata": metadata,
334
+ }
335
 
336
  with self.var_lock.rw:
337
  self.submission_ids = submission_ids
 
605
  model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
606
  local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
607
 
608
+ if to_csv:
609
+ n_shot = data["metadata"].get("n-shot", "")
610
+ local_results["n-shot"] = n_shot
611
+
612
  release = data["submission_metadata"].get("submission_timestamp")
613
  release = time.strftime("%Y-%m-%d", time.gmtime(release)) if release else "N/A"
614
  local_results["release"] = release
 
640
  "release",
641
  "model_type",
642
  "parameters",
643
+ "n-shot",
644
  "average_score",
645
  ]
646
  df_order = [