Spaces:
Running
Running
the maximum length of the model title is now as constant
Browse files
server.py
CHANGED
@@ -156,6 +156,7 @@ class LeaderboardServer:
|
|
156 |
self.TASKS_CATEGORIES = {self.TASKS_METADATA[task]["category"] for task in self.TASKS_METADATA}
|
157 |
self.TASKS_CATEGORY_OVERALL = "Overall"
|
158 |
self.CATEGORY_TO_TASK_ABBREVIATION_TO_DETAILS = self._prepare_category_to_task_abbr_to_details()
|
|
|
159 |
|
160 |
self.var_lock = ReadWriteLock()
|
161 |
self.submission_ids = set()
|
@@ -347,8 +348,8 @@ class LeaderboardServer:
|
|
347 |
|
348 |
model_link = data["metadata"]["link_to_model"]
|
349 |
model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
|
350 |
-
model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"],
|
351 |
-
model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"],
|
352 |
model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
|
353 |
match_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
|
354 |
|
@@ -444,8 +445,8 @@ class LeaderboardServer:
|
|
444 |
|
445 |
model_link = data["metadata"]["link_to_model"]
|
446 |
model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
|
447 |
-
model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"],
|
448 |
-
model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"],
|
449 |
model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
|
450 |
local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
|
451 |
release = data["metadata"].get("submission_timestamp")
|
|
|
156 |
self.TASKS_CATEGORIES = {self.TASKS_METADATA[task]["category"] for task in self.TASKS_METADATA}
|
157 |
self.TASKS_CATEGORY_OVERALL = "Overall"
|
158 |
self.CATEGORY_TO_TASK_ABBREVIATION_TO_DETAILS = self._prepare_category_to_task_abbr_to_details()
|
159 |
+
self.MAX_LENGTH_OF_MODEL_TITLE = 28
|
160 |
|
161 |
self.var_lock = ReadWriteLock()
|
162 |
self.submission_ids = set()
|
|
|
348 |
|
349 |
model_link = data["metadata"]["link_to_model"]
|
350 |
model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
|
351 |
+
model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"], self.MAX_LENGTH_OF_MODEL_TITLE)
|
352 |
+
model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"], self.MAX_LENGTH_OF_MODEL_TITLE)
|
353 |
model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
|
354 |
match_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
|
355 |
|
|
|
445 |
|
446 |
model_link = data["metadata"]["link_to_model"]
|
447 |
model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
|
448 |
+
model_title_abbr_team_name = self.abbreviate(data["metadata"]["team_name"], self.MAX_LENGTH_OF_MODEL_TITLE)
|
449 |
+
model_title_abbr_model_name = self.abbreviate(data["metadata"]["model_name"], self.MAX_LENGTH_OF_MODEL_TITLE)
|
450 |
model_title_abbr_html = f'<div style="font-size: 10px;">{xmlAndMarkdownEscape(model_title_abbr_team_name)}</div>{xmlAndMarkdownEscape(model_title_abbr_model_name)}'
|
451 |
local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{model_title_abbr_html}</a>'
|
452 |
release = data["metadata"].get("submission_timestamp")
|