idolezal commited on
Commit
20d80fe
β€’
1 Parent(s): 6bae7e8

Defined xmlAndMarkdownEscape() function

Browse files
Files changed (1) hide show
  1. server.py +5 -2
server.py CHANGED
@@ -54,6 +54,9 @@ MARKDOWN_SPECIAL_CHARACTERS = {
54
  "|": "|"
55
  }
56
 
 
 
 
57
  def check_significance_send_task(model_a_path, model_b_path):
58
  url = 'https://czechllm.fit.vutbr.cz/benczechmark-leaderboard/compare_significance/'
59
 
@@ -331,7 +334,7 @@ class LeaderboardServer:
331
  model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
332
  model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"], 28)
333
  model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"], 28)
334
- model_title_abbr_html = f'<div style="font-size: 10px;">{xmlEscape(model_title_abbr_team_name, MARKDOWN_SPECIAL_CHARACTERS)}</div>{xmlEscape(model_title_abbr_model_name, MARKDOWN_SPECIAL_CHARACTERS)}'
335
  match_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
336
 
337
  model_tournament_table.append(match_results)
@@ -428,7 +431,7 @@ class LeaderboardServer:
428
  model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
429
  model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"], 28)
430
  model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"], 28)
431
- model_title_abbr_html = f'<div style="font-size: 10px;">{xmlEscape(model_title_abbr_team_name, MARKDOWN_SPECIAL_CHARACTERS)}</div>{xmlEscape(model_title_abbr_model_name, MARKDOWN_SPECIAL_CHARACTERS)}'
432
  local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
433
  release = data["metadata"].get("submission_timestamp")
434
  release = time.strftime("%Y-%m-%d", time.gmtime(release)) if release else "N/A"
 
54
  "|": "&#124;"
55
  }
56
 
57
+ def xmlAndMarkdownEscape(text):
58
+ return xmlEscape(text, MARKDOWN_SPECIAL_CHARACTERS)
59
+
60
  def check_significance_send_task(model_a_path, model_b_path):
61
  url = 'https://czechllm.fit.vutbr.cz/benczechmark-leaderboard/compare_significance/'
62
 
 
334
  model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
335
  model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"], 28)
336
  model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"], 28)
337
+ model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
338
  match_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
339
 
340
  model_tournament_table.append(match_results)
 
431
  model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
432
  model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"], 28)
433
  model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"], 28)
434
+ model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
435
  local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
436
  release = data["metadata"].get("submission_timestamp")
437
  release = time.strftime("%Y-%m-%d", time.gmtime(release)) if release else "N/A"