Spaces:
Running
Running
Markdown esacape
Browse files
server.py
CHANGED
@@ -22,6 +22,26 @@ REPO = f"{ORG}/LLM_benchmark_data"
|
|
22 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
23 |
TASKS_METADATA_PATH = "./tasks_metadata.json"
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
class LeaderboardServer:
|
26 |
def __init__(self):
|
27 |
self.server_address = REPO
|
@@ -111,7 +131,7 @@ class LeaderboardServer:
|
|
111 |
model_link = data["metadata"]["link_to_model"]
|
112 |
model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
|
113 |
model_title_abbr = self.abbreviate(data["metadata"]["team_name"], 14) + "/" + self.abbreviate(data["metadata"]["model_name"], 14)
|
114 |
-
local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{xmlEscape(model_title_abbr)}</a>'
|
115 |
release = data["metadata"].get("submission_timestamp")
|
116 |
release = time.strftime("%Y-%m-%d", time.gmtime(release)) if release else "N/A"
|
117 |
local_results["release"] = release
|
|
|
22 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
23 |
TASKS_METADATA_PATH = "./tasks_metadata.json"
|
24 |
|
25 |
+
MARKDOWN_SPECIAL_CHARACTERS = {
|
26 |
+
"#": "#", # for usage in xml.sax.saxutils.escape as entities must be first
|
27 |
+
"\\": "\",
|
28 |
+
"`": "`",
|
29 |
+
"*": "*",
|
30 |
+
"_": "_",
|
31 |
+
"{": "{",
|
32 |
+
"}": "}",
|
33 |
+
"[": "[",
|
34 |
+
"]": "]",
|
35 |
+
"(": "(",
|
36 |
+
")": ")",
|
37 |
+
"+": "+",
|
38 |
+
"-": "-",
|
39 |
+
".": ".",
|
40 |
+
"!": "!",
|
41 |
+
"=": "=",
|
42 |
+
"|": "|"
|
43 |
+
}
|
44 |
+
|
45 |
class LeaderboardServer:
|
46 |
def __init__(self):
|
47 |
self.server_address = REPO
|
|
|
131 |
model_link = data["metadata"]["link_to_model"]
|
132 |
model_title = data["metadata"]["team_name"] + "/" + data["metadata"]["model_name"]
|
133 |
model_title_abbr = self.abbreviate(data["metadata"]["team_name"], 14) + "/" + self.abbreviate(data["metadata"]["model_name"], 14)
|
134 |
+
local_results["model"] = f'<a href={xmlQuoteAttr(model_link)} title={xmlQuoteAttr(model_title)}>{xmlEscape(model_title_abbr, MARKDOWN_SPECIAL_CHARACTERS)}</a>'
|
135 |
release = data["metadata"].get("submission_timestamp")
|
136 |
release = time.strftime("%Y-%m-%d", time.gmtime(release)) if release else "N/A"
|
137 |
local_results["release"] = release
|