facat commited on
Commit
72ccff7
1 Parent(s): 33af91b

update index

Browse files
Files changed (3) hide show
  1. index.html +690 -18
  2. tasks.py +0 -1
  3. tlem.py +1 -4
index.html CHANGED
@@ -1,19 +1,691 @@
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
3
+
4
+ <meta charset="utf-8">
5
+ <meta name="generator" content="quarto-1.3.450">
6
+
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
8
+
9
+
10
+ <title>Transparent LLMs Evaluation Metrics</title>
11
+ <style>
12
+ code{white-space: pre-wrap;}
13
+ span.smallcaps{font-variant: small-caps;}
14
+ div.columns{display: flex; gap: min(4vw, 1.5em);}
15
+ div.column{flex: auto; overflow-x: auto;}
16
+ div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
17
+ ul.task-list{list-style: none;}
18
+ ul.task-list li input[type="checkbox"] {
19
+ width: 0.8em;
20
+ margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
21
+ vertical-align: middle;
22
+ }
23
+ /* CSS for syntax highlighting */
24
+ pre > code.sourceCode { white-space: pre; position: relative; }
25
+ pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
26
+ pre > code.sourceCode > span:empty { height: 1.2em; }
27
+ .sourceCode { overflow: visible; }
28
+ code.sourceCode > span { color: inherit; text-decoration: inherit; }
29
+ div.sourceCode { margin: 1em 0; }
30
+ pre.sourceCode { margin: 0; }
31
+ @media screen {
32
+ div.sourceCode { overflow: auto; }
33
+ }
34
+ @media print {
35
+ pre > code.sourceCode { white-space: pre-wrap; }
36
+ pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
37
+ }
38
+ pre.numberSource code
39
+ { counter-reset: source-line 0; }
40
+ pre.numberSource code > span
41
+ { position: relative; left: -4em; counter-increment: source-line; }
42
+ pre.numberSource code > span > a:first-child::before
43
+ { content: counter(source-line);
44
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
45
+ border: none; display: inline-block;
46
+ -webkit-touch-callout: none; -webkit-user-select: none;
47
+ -khtml-user-select: none; -moz-user-select: none;
48
+ -ms-user-select: none; user-select: none;
49
+ padding: 0 4px; width: 4em;
50
+ }
51
+ pre.numberSource { margin-left: 3em; padding-left: 4px; }
52
+ div.sourceCode
53
+ { }
54
+ @media screen {
55
+ pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
56
+ }
57
+ </style>
58
+
59
+
60
+ <script src="README_files/libs/clipboard/clipboard.min.js"></script>
61
+ <script src="README_files/libs/quarto-html/quarto.js"></script>
62
+ <script src="README_files/libs/quarto-html/popper.min.js"></script>
63
+ <script src="README_files/libs/quarto-html/tippy.umd.min.js"></script>
64
+ <script src="README_files/libs/quarto-html/anchor.min.js"></script>
65
+ <link href="README_files/libs/quarto-html/tippy.css" rel="stylesheet">
66
+ <link href="README_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
67
+ <script src="README_files/libs/bootstrap/bootstrap.min.js"></script>
68
+ <link href="README_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
69
+ <link href="README_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
70
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous"></script>
71
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
72
+ <script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>
73
+ <script src="https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js" crossorigin="anonymous"></script>
74
+
75
+
76
+ </head>
77
+
78
+ <body class="fullcontent">
79
+
80
+ <div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
81
+
82
+ <main class="content" id="quarto-document-content">
83
+
84
+ <header id="title-block-header" class="quarto-title-block default">
85
+ <div class="quarto-title">
86
+ <h1 class="title">Transparent LLMs Evaluation Metrics</h1>
87
+ </div>
88
+
89
+
90
+
91
+ <div class="quarto-title-meta">
92
+
93
+
94
+
95
+
96
+ </div>
97
+
98
+
99
+ </header>
100
+
101
+ <section id="introducing-tlem-the-future-of-language-model-evaluation" class="level1">
102
+ <h1>Introducing TLEM: The Future of Language Model Evaluation 🌐✨</h1>
103
+ <p>In an era where the globe is racing to train and launch increasingly sophisticated language models, there’s a pressing need for a unified standard to gauge their effectiveness. That’s where TLEM, or Transparent LLMs Evaluation Metrics – a nod to the French phrase <strong>tout le monde</strong> (everyone) – steps in. TLEM is not just another framework; it’s a revolution in the way we assess language models. Its name embodies our commitment to transparency and decentralization in the evaluation of large language models.</p>
104
+ <section id="why-tlem-heres-why" class="level2">
105
+ <h2 class="anchored" data-anchor-id="why-tlem-heres-why">🌟 Why TLEM? Here’s Why!</h2>
106
+ <ul>
107
+ <li><p>Universal Standardization: With the international community eager to develop and unveil large language models, TLEM offers a much-needed standardized criterion to differentiate the good from the great.</p></li>
108
+ <li><p>Developer &amp; User-Friendly: Existing open-source implementations often suffer from deep encapsulation, posing challenges for both developers and users. TLEM changes the game by being incredibly user-friendly and accessible.</p></li>
109
+ <li><p>Addressing the Self-Evaluation Bias: A common hurdle in the current landscape is the tendency of models to self-evaluate, leading to a reliance on their own assessments and only referencing open-source evaluations. This has resulted in redundant efforts and reduced reproducibility within the open-source community. TLEM tackles this issue head-on.</p></li>
110
+ <li><p>Designed for Ease and Decentralization: TLEM stands out with its extreme ease of use. Forget the hassle of manually pulling repositories and installing – TLEM simplifies it all. Moreover, its metrics are designed to be decentralized, empowering users to extend and contribute new evaluation metrics, fostering a community-driven approach.</p></li>
111
+ </ul>
112
+ </section>
113
+ <section id="join-the-tlem-movement" class="level2">
114
+ <h2 class="anchored" data-anchor-id="join-the-tlem-movement">🚀 Join the TLEM Movement!</h2>
115
+ <p>TLEM is more than a framework; it’s a movement towards a more transparent, decentralized, and community-driven future in language model evaluation. Be a part of this exciting journey. Dive into the world of TLEM, where every contribution counts, and every evaluation brings us closer to excellence in language model development.</p>
116
+ <p>Let’s shape the future together with TLEM! 🌟💻🔍</p>
117
+ </section>
118
+ </section>
119
+ <section id="usage" class="level1">
120
+ <h1>Usage</h1>
121
+ <section id="start-evaluating-your-model-in-3-line" class="level2">
122
+ <h2 class="anchored" data-anchor-id="start-evaluating-your-model-in-3-line">Start evaluating your model in 3 line</h2>
123
+ <p>You can start evaluating your model with TLEM in 3 lines, tlem is designed to work without installing.</p>
124
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:47.835488Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:44.915535Z&quot;}" data-execution_count="2">
125
+ <div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>suite <span class="op">=</span> evaluate.EvaluationSuite.load(<span class="st">"SUSTech/tlem"</span>, download_mode<span class="op">=</span><span class="st">"force_redownload"</span>)</span>
126
+ <span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>suite.load(<span class="st">"gsm8k"</span>) <span class="co"># You can check the available datasets by suite.supported_datasets</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
127
+ </div>
128
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:55.391135Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:55.266737Z&quot;}" data-execution_count="4">
129
+ <div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>suite.run(pipe <span class="op">:=</span> <span class="kw">lambda</span> x: x)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
130
+ <div class="cell-output cell-output-display">
131
+ <script type="application/vnd.jupyter.widget-view+json">
132
+ {"model_id":"bf385f9d1496433daadde6b638f81f15","version_major":2,"version_minor":0,"quarto_mimetype":"application/vnd.jupyter.widget-view+json"}
133
+ </script>
134
+ </div>
135
+ <div class="cell-output cell-output-display" data-execution_count="4">
136
+ <pre><code>{'gsm8k': 0.022744503411675512}</code></pre>
137
+ </div>
138
+ </div>
139
+ <p>The lambda function indicate a model pipeline which takes a list of string as input and return a list of string as output. You can use any model you want, as long as it can be wrapped in this way. We use the most popular VLLM and Openai API as an example:</p>
140
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:55.433370Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:55.392566Z&quot;}" data-execution_count="5">
141
+ <div class="sourceCode cell-code" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>session <span class="op">=</span> aiohttp.ClientSession(timeout<span class="op">=</span>aiohttp.ClientTimeout(total<span class="op">=</span><span class="dv">60</span> <span class="op">*</span> <span class="dv">60</span> <span class="op">*</span> <span class="dv">24</span> <span class="op">*</span> <span class="dv">7</span>))</span>
142
+ <span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>url <span class="op">=</span> <span class="st">"xxx"</span></span>
143
+ <span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>client <span class="op">=</span> AsyncOpenAI(<span class="op">**</span>{<span class="st">"base_url"</span>: <span class="ss">f"http://</span><span class="sc">{</span>url<span class="sc">}</span><span class="ss">/v1/"</span>, <span class="st">"api_key"</span>: <span class="st">"EMPTY"</span>})</span>
144
+ <span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
145
+ <span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a></span>
146
+ <span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a><span class="at">@suite.utils.async_pipe</span></span>
147
+ <span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="cf">async</span> <span class="kw">def</span> chatgpt(msg):</span>
148
+ <span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> <span class="bu">input</span> <span class="op">=</span> <span class="ss">f"### Human: </span><span class="sc">{</span>msg<span class="sc">}</span><span class="ch">\n\n</span><span class="ss">### Assistant: "</span></span>
149
+ <span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
150
+ <span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> resp <span class="op">=</span> <span class="cf">await</span> client.completions.create(</span>
151
+ <span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a> model<span class="op">=</span><span class="st">"gpt-3.5-turbo"</span>,</span>
152
+ <span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a> max_tokens<span class="op">=</span><span class="va">None</span>,</span>
153
+ <span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a> prompt<span class="op">=</span><span class="bu">input</span>,</span>
154
+ <span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a> temperature<span class="op">=</span><span class="dv">0</span>,</span>
155
+ <span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> )</span>
156
+ <span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> resp.choices[<span class="dv">0</span>].text</span>
157
+ <span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span> <span class="pp">Exception</span> <span class="im">as</span> e:</span>
158
+ <span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="st">"OpenAI Error"</span></span>
159
+ <span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a></span>
160
+ <span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a></span>
161
+ <span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a><span class="at">@suite.utils.async_pipe</span></span>
162
+ <span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a><span class="cf">async</span> <span class="kw">def</span> vllm(msg):</span>
163
+ <span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a> <span class="bu">input</span> <span class="op">=</span> <span class="ss">f"### Human: </span><span class="sc">{</span>msg<span class="sc">}</span><span class="ch">\n\n</span><span class="ss">### Assistant: "</span></span>
164
+ <span id="cb4-24"><a href="#cb4-24" aria-hidden="true" tabindex="-1"></a> data <span class="op">=</span> {</span>
165
+ <span id="cb4-25"><a href="#cb4-25" aria-hidden="true" tabindex="-1"></a> <span class="st">"prompt"</span>: <span class="bu">input</span>,</span>
166
+ <span id="cb4-26"><a href="#cb4-26" aria-hidden="true" tabindex="-1"></a> <span class="st">"max_tokens"</span>: <span class="dv">4096</span>,</span>
167
+ <span id="cb4-27"><a href="#cb4-27" aria-hidden="true" tabindex="-1"></a> <span class="st">"n"</span>: <span class="dv">1</span>,</span>
168
+ <span id="cb4-28"><a href="#cb4-28" aria-hidden="true" tabindex="-1"></a> <span class="st">"temperature"</span>: <span class="dv">0</span>,</span>
169
+ <span id="cb4-29"><a href="#cb4-29" aria-hidden="true" tabindex="-1"></a> }</span>
170
+ <span id="cb4-30"><a href="#cb4-30" aria-hidden="true" tabindex="-1"></a></span>
171
+ <span id="cb4-31"><a href="#cb4-31" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
172
+ <span id="cb4-32"><a href="#cb4-32" aria-hidden="true" tabindex="-1"></a> <span class="cf">async</span> <span class="cf">with</span> session.post(<span class="ss">f"http://</span><span class="sc">{</span>url<span class="sc">}</span><span class="ss">/generate"</span>, json<span class="op">=</span>data) <span class="im">as</span> response:</span>
173
+ <span id="cb4-33"><a href="#cb4-33" aria-hidden="true" tabindex="-1"></a> response_json <span class="op">=</span> <span class="cf">await</span> response.json()</span>
174
+ <span id="cb4-34"><a href="#cb4-34" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> response_json[<span class="st">"text"</span>][<span class="dv">0</span>][<span class="bu">len</span>(<span class="bu">input</span>) :]</span>
175
+ <span id="cb4-35"><a href="#cb4-35" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span> <span class="pp">Exception</span> <span class="im">as</span> e:</span>
176
+ <span id="cb4-36"><a href="#cb4-36" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="st">"Vllm Error"</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
177
+ </div>
178
+ </section>
179
+ </section>
180
+ <section id="hackable" class="level1">
181
+ <h1>Hackable</h1>
182
+ </section>
183
+ <section id="section" class="level1">
184
+ <h1></h1>
185
+ <p>TLEM is designed to be hackable. Every tlem is a <code>task</code> in the <code>suite</code>, <code>suite.run</code> just run all the tasks in the suite. For each task, you can check it’s input, label and output by</p>
186
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:55.443078Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:55.434617Z&quot;}" data-execution_count="6">
187
+ <div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>task <span class="op">=</span> suite[<span class="dv">0</span>]</span>
188
+ <span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="co"># task.outputs is avaliable after suite.run or task.run</span></span>
189
+ <span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>pd.DataFrame({<span class="st">"input"</span>: task.samples, <span class="st">"label"</span>: task.labels, <span class="st">"output"</span>: task.outputs})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
190
+ <div class="cell-output cell-output-display" data-execution_count="6">
191
+ <div>
192
+
193
+
194
+ <table class="dataframe table table-sm table-striped small" data-quarto-postprocess="true" data-border="1">
195
+ <thead>
196
+ <tr class="header">
197
+ <th data-quarto-table-cell-role="th"></th>
198
+ <th data-quarto-table-cell-role="th">input</th>
199
+ <th data-quarto-table-cell-role="th">label</th>
200
+ <th data-quarto-table-cell-role="th">output</th>
201
+ </tr>
202
+ </thead>
203
+ <tbody>
204
+ <tr class="odd">
205
+ <td data-quarto-table-cell-role="th">0</td>
206
+ <td>Janet’s ducks lay 16 eggs per day. She eats th...</td>
207
+ <td>Janet sells 16 - 3 - 4 = &lt;&lt;16-3-4=9&gt;&gt;9 duck eg...</td>
208
+ <td>Janet’s ducks lay 16 eggs per day. She eats th...</td>
209
+ </tr>
210
+ <tr class="even">
211
+ <td data-quarto-table-cell-role="th">1</td>
212
+ <td>A robe takes 2 bolts of blue fiber and half th...</td>
213
+ <td>It takes 2/2=&lt;&lt;2/2=1&gt;&gt;1 bolt of white fiber\nS...</td>
214
+ <td>A robe takes 2 bolts of blue fiber and half th...</td>
215
+ </tr>
216
+ <tr class="odd">
217
+ <td data-quarto-table-cell-role="th">2</td>
218
+ <td>Josh decides to try flipping a house. He buys...</td>
219
+ <td>The cost of the house and repairs came out to ...</td>
220
+ <td>Josh decides to try flipping a house. He buys...</td>
221
+ </tr>
222
+ <tr class="even">
223
+ <td data-quarto-table-cell-role="th">3</td>
224
+ <td>James decides to run 3 sprints 3 times a week....</td>
225
+ <td>He sprints 3*3=&lt;&lt;3*3=9&gt;&gt;9 times\nSo he runs 9*...</td>
226
+ <td>James decides to run 3 sprints 3 times a week....</td>
227
+ </tr>
228
+ <tr class="odd">
229
+ <td data-quarto-table-cell-role="th">4</td>
230
+ <td>Every day, Wendi feeds each of her chickens th...</td>
231
+ <td>If each chicken eats 3 cups of feed per day, t...</td>
232
+ <td>Every day, Wendi feeds each of her chickens th...</td>
233
+ </tr>
234
+ <tr class="even">
235
+ <td data-quarto-table-cell-role="th">...</td>
236
+ <td>...</td>
237
+ <td>...</td>
238
+ <td>...</td>
239
+ </tr>
240
+ <tr class="odd">
241
+ <td data-quarto-table-cell-role="th">1314</td>
242
+ <td>John had a son James when he was 19. James is...</td>
243
+ <td>Dora is 12-3=&lt;&lt;12-3=9&gt;&gt;9\nSo James is 9*2=&lt;&lt;9*...</td>
244
+ <td>John had a son James when he was 19. James is...</td>
245
+ </tr>
246
+ <tr class="even">
247
+ <td data-quarto-table-cell-role="th">1315</td>
248
+ <td>There are some oranges in a basket. Ana spends...</td>
249
+ <td>There are 60 minutes in an hour. Ana peels an ...</td>
250
+ <td>There are some oranges in a basket. Ana spends...</td>
251
+ </tr>
252
+ <tr class="odd">
253
+ <td data-quarto-table-cell-role="th">1316</td>
254
+ <td>Mark's car breaks down and he needs to get a n...</td>
255
+ <td>The discount on the radiator was 400*.8=$&lt;&lt;400...</td>
256
+ <td>Mark's car breaks down and he needs to get a n...</td>
257
+ </tr>
258
+ <tr class="even">
259
+ <td data-quarto-table-cell-role="th">1317</td>
260
+ <td>Farmer Brown has 20 animals on his farm, all e...</td>
261
+ <td>Let C be the number of chickens.\nThere are 20...</td>
262
+ <td>Farmer Brown has 20 animals on his farm, all e...</td>
263
+ </tr>
264
+ <tr class="odd">
265
+ <td data-quarto-table-cell-role="th">1318</td>
266
+ <td>Henry and 3 of his friends order 7 pizzas for ...</td>
267
+ <td>There are 7*8=&lt;&lt;7*8=56&gt;&gt;56 slices in total.\nT...</td>
268
+ <td>Henry and 3 of his friends order 7 pizzas for ...</td>
269
+ </tr>
270
+ </tbody>
271
+ </table>
272
+
273
+ <p>1319 rows × 3 columns</p>
274
+ </div>
275
+ </div>
276
+ </div>
277
+ <p>and you can verify our metric by</p>
278
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:55.499005Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:55.444459Z&quot;}" data-execution_count="7">
279
+ <div class="sourceCode cell-code" id="cb6"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>task.metric(task.labels, task.labels)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
280
+ <div class="cell-output cell-output-display" data-execution_count="7">
281
+ <pre><code>{'gsm8k': 1.0}</code></pre>
282
+ </div>
283
+ </div>
284
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:55.541161Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:55.500362Z&quot;}" data-execution_count="8">
285
+ <div class="sourceCode cell-code" id="cb8"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>task.metric(task.outputs, task.labels)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
286
+ <div class="cell-output cell-output-display" data-execution_count="8">
287
+ <pre><code>{'gsm8k': 0.022744503411675512}</code></pre>
288
+ </div>
289
+ </div>
290
+ </section>
291
+ <section id="contribution" class="level1">
292
+ <h1>Contribution</h1>
293
+ </section>
294
+ <section id="section-1" class="level1">
295
+ <h1></h1>
296
+ <p>You can easily add your own task by inheriting the <code>Task</code> class. For example, if you want to add a task to evaluate the model’s ability to generate a specific type of text, you can do it in this way:</p>
297
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:59.542396Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:55.542504Z&quot;}" data-execution_count="9">
298
+ <div class="sourceCode cell-code" id="cb10"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>task <span class="op">=</span> suite.task_class(</span>
299
+ <span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> dataset_name<span class="op">=</span>(<span class="st">"gsm8k"</span>, <span class="st">"main"</span>),</span>
300
+ <span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> input_column<span class="op">=</span><span class="st">"question"</span>,</span>
301
+ <span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> label_column<span class="op">=</span><span class="st">"answer"</span>,</span>
302
+ <span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> metric_name<span class="op">=</span><span class="st">"evaluate-metric/competition_math"</span>,</span>
303
+ <span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a>)</span>
304
+ <span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a>task.run(pipe)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
305
+ <div class="cell-output cell-output-stdout">
306
+ <pre><code>&lt;class 'evaluate_modules.metrics.evaluate-metric--competition_math.b85814e0172dae97fa4bd6eff6f33caba2ff9547860acabd50222c6dee474a24.competition_math.CompetitionMathMetric'&gt;</code></pre>
307
+ </div>
308
+ <div class="cell-output cell-output-display" data-execution_count="9">
309
+ <pre><code>{'accuracy': 0.0}</code></pre>
310
+ </div>
311
+ </div>
312
+ <p>where the metric can be put in any huggingface space, TLEM is designed to be decentralized, allowing you to run evaluations on private datasets without the need to contribute your code back to TLEM. You can also define the metric locally:</p>
313
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-02T17:55:59.551341Z&quot;,&quot;start_time&quot;:&quot;2023-12-02T17:55:59.544629Z&quot;}" data-execution_count="10">
314
+ <div class="sourceCode cell-code" id="cb13"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="kw">def</span> my_metric(responses, references):</span>
315
+ <span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># return .99</span></span>
316
+ <span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a> scores <span class="op">=</span> [random.choices([<span class="dv">0</span>, <span class="dv">1</span>]) <span class="cf">for</span> resp, ans <span class="kw">in</span> <span class="bu">zip</span>(responses, references)]</span>
317
+ <span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> np.mean(scores)</span>
318
+ <span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a></span>
319
+ <span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a></span>
320
+ <span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a>task.metric <span class="op">=</span> my_metric</span>
321
+ <span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a>task.run(pipe)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
322
+ <div class="cell-output cell-output-display" data-execution_count="10">
323
+ <pre><code>0.5034116755117514</code></pre>
324
+ </div>
325
+ </div>
326
+ <section id="tlem-leaderboard" class="level2">
327
+ <h2 class="anchored" data-anchor-id="tlem-leaderboard">TLEM Leaderboard</h2>
328
+ <p>If you wish to add your model results to the TLEM leaderboard, you are required to provide the code used for running TLEM and its outcomes in your model card. We do not actively replicate your code; you are responsible for the accuracy of your results.</p>
329
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-03T19:07:31.609321Z&quot;,&quot;start_time&quot;:&quot;2023-12-03T19:07:29.116542Z&quot;}" data-execution_count="110">
330
+ <div id="fig-polar" class="quarto-figure quarto-figure-center anchored">
331
+ <figure class="figure">
332
+ <div>
333
+
334
+
335
+ <table class="dataframe table table-sm table-striped small" data-quarto-postprocess="true" data-border="1">
336
+ <thead>
337
+ <tr class="header">
338
+ <th data-quarto-table-cell-role="th"></th>
339
+ <th data-quarto-table-cell-role="th">mmlu-chat</th>
340
+ <th data-quarto-table-cell-role="th">cmmlu-chat</th>
341
+ <th data-quarto-table-cell-role="th">ceval-chat</th>
342
+ <th data-quarto-table-cell-role="th">gsm8k</th>
343
+ <th data-quarto-table-cell-role="th">BBH</th>
344
+ <th data-quarto-table-cell-role="th">MATH</th>
345
+ <th data-quarto-table-cell-role="th">average</th>
346
+ </tr>
347
+ <tr class="odd">
348
+ <th data-quarto-table-cell-role="th">model</th>
349
+ <th data-quarto-table-cell-role="th"></th>
350
+ <th data-quarto-table-cell-role="th"></th>
351
+ <th data-quarto-table-cell-role="th"></th>
352
+ <th data-quarto-table-cell-role="th"></th>
353
+ <th data-quarto-table-cell-role="th"></th>
354
+ <th data-quarto-table-cell-role="th"></th>
355
+ <th data-quarto-table-cell-role="th"></th>
356
+ </tr>
357
+ </thead>
358
+ <tbody>
359
+ <tr class="odd">
360
+ <td data-quarto-table-cell-role="th">SUS-Chat-34B</td>
361
+ <td>77.35</td>
362
+ <td>78.68</td>
363
+ <td>82.42</td>
364
+ <td>80.06</td>
365
+ <td>67.62</td>
366
+ <td>28.80</td>
367
+ <td>69.155000</td>
368
+ </tr>
369
+ <tr class="even">
370
+ <td data-quarto-table-cell-role="th">Qwen-72B-Chat</td>
371
+ <td>74.52</td>
372
+ <td>77.02</td>
373
+ <td>77.22</td>
374
+ <td>76.57</td>
375
+ <td>72.63</td>
376
+ <td>35.90</td>
377
+ <td>68.976667</td>
378
+ </tr>
379
+ <tr class="odd">
380
+ <td data-quarto-table-cell-role="th">DeepSeek-67B-Chat</td>
381
+ <td>69.43</td>
382
+ <td>48.51</td>
383
+ <td>59.70</td>
384
+ <td>74.45</td>
385
+ <td>69.73</td>
386
+ <td>29.56</td>
387
+ <td>58.563333</td>
388
+ </tr>
389
+ <tr class="even">
390
+ <td data-quarto-table-cell-role="th">Yi-34B-Chat</td>
391
+ <td>66.96</td>
392
+ <td>55.16</td>
393
+ <td>77.16</td>
394
+ <td>63.76</td>
395
+ <td>61.54</td>
396
+ <td>10.02</td>
397
+ <td>55.766667</td>
398
+ </tr>
399
+ <tr class="odd">
400
+ <td data-quarto-table-cell-role="th">OrionStar-34B</td>
401
+ <td>68.51</td>
402
+ <td>66.88</td>
403
+ <td>65.13</td>
404
+ <td>54.36</td>
405
+ <td>62.88</td>
406
+ <td>12.80</td>
407
+ <td>55.093333</td>
408
+ </tr>
409
+ </tbody>
410
+ </table>
411
+
412
+ </div>
413
+ <figcaption class="figure-caption">Figure&nbsp;1: TLEM leaderboard</figcaption>
414
+ </figure>
415
+ </div>
416
+ </div>
417
+ <div class="cell" data-executetime="{&quot;end_time&quot;:&quot;2023-12-03T19:07:00.676753Z&quot;,&quot;start_time&quot;:&quot;2023-12-03T19:07:00.662376Z&quot;}" data-execution_count="109">
418
+ <div class="cell-output cell-output-display">
419
+
420
+ <div> <div id="54d40fc8-bbd7-4d1e-82b9-a30e0c32b0e7" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("54d40fc8-bbd7-4d1e-82b9-a30e0c32b0e7")) { Plotly.newPlot( "54d40fc8-bbd7-4d1e-82b9-a30e0c32b0e7", [{"fill":"toself","name":"OrionStar-34B","r":[68.51,66.88,65.13,54.36,62.88,12.8,55.09333333333333],"theta":["mmlu-chat","cmmlu-chat","ceval-chat","gsm8k","BBH","MATH"],"type":"scatterpolar"},{"fill":"toself","name":"Yi-34B-Chat","r":[66.96,55.16,77.16,63.76,61.54,10.02,55.76666666666666],"theta":["mmlu-chat","cmmlu-chat","ceval-chat","gsm8k","BBH","MATH"],"type":"scatterpolar"},{"fill":"toself","name":"Qwen-72B-Chat","r":[74.52,77.02,77.22,76.57,72.63,35.9,68.97666666666666],"theta":["mmlu-chat","cmmlu-chat","ceval-chat","gsm8k","BBH","MATH"],"type":"scatterpolar"},{"fill":"toself","name":"DeepSeek-67B-Chat","r":[69.43,48.51,59.7,74.45,69.73,29.56,58.56333333333333],"theta":["mmlu-chat","cmmlu-chat","ceval-chat","gsm8k","BBH","MATH"],"type":"scatterpolar"},{"fill":"toself","name":"SUS-Chat-34B","r":[77.35,78.68,82.42,80.06,67.62,28.8,69.155],"theta":["mmlu-chat","cmmlu-chat","ceval-chat","gsm8k","BBH","MATH"],"type":"scatterpolar"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"polar":{"radialaxis":{"visible":true,"range":[0,82.42]}},"showlegend":true}, {"responsive": true} ).then(function(){
421
+
422
+ var gd = document.getElementById('54d40fc8-bbd7-4d1e-82b9-a30e0c32b0e7');
423
+ var x = new MutationObserver(function (mutations, observer) {{
424
+ var display = window.getComputedStyle(gd).display;
425
+ if (!display || display === 'none') {{
426
+ console.log([gd, 'removed!']);
427
+ Plotly.purge(gd);
428
+ observer.disconnect();
429
+ }}
430
+ }});
431
+
432
+ // Listen for the removal of the full notebook cells
433
+ var notebookContainer = gd.closest('#notebook-container');
434
+ if (notebookContainer) {{
435
+ x.observe(notebookContainer, {childList: true});
436
+ }}
437
+
438
+ // Listen for the clearing of the current output cell
439
+ var outputEl = gd.closest('.output');
440
+ if (outputEl) {{
441
+ x.observe(outputEl, {childList: true});
442
+ }}
443
+
444
+ }) }; }); </script> </div>
445
+ <p>TLEM leaderboard</p>
446
+ </div>
447
+ </div>
448
+ <p>Embrace the change. Embrace TLEM.</p>
449
+ </section>
450
+ </section>
451
+
452
+ </main>
453
+ <!-- /main column -->
454
+ <script id="quarto-html-after-body" type="application/javascript">
455
+ window.document.addEventListener("DOMContentLoaded", function (event) {
456
+ const toggleBodyColorMode = (bsSheetEl) => {
457
+ const mode = bsSheetEl.getAttribute("data-mode");
458
+ const bodyEl = window.document.querySelector("body");
459
+ if (mode === "dark") {
460
+ bodyEl.classList.add("quarto-dark");
461
+ bodyEl.classList.remove("quarto-light");
462
+ } else {
463
+ bodyEl.classList.add("quarto-light");
464
+ bodyEl.classList.remove("quarto-dark");
465
+ }
466
+ }
467
+ const toggleBodyColorPrimary = () => {
468
+ const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
469
+ if (bsSheetEl) {
470
+ toggleBodyColorMode(bsSheetEl);
471
+ }
472
+ }
473
+ toggleBodyColorPrimary();
474
+ const icon = "";
475
+ const anchorJS = new window.AnchorJS();
476
+ anchorJS.options = {
477
+ placement: 'right',
478
+ icon: icon
479
+ };
480
+ anchorJS.add('.anchored');
481
+ const isCodeAnnotation = (el) => {
482
+ for (const clz of el.classList) {
483
+ if (clz.startsWith('code-annotation-')) {
484
+ return true;
485
+ }
486
+ }
487
+ return false;
488
+ }
489
+ const clipboard = new window.ClipboardJS('.code-copy-button', {
490
+ text: function(trigger) {
491
+ const codeEl = trigger.previousElementSibling.cloneNode(true);
492
+ for (const childEl of codeEl.children) {
493
+ if (isCodeAnnotation(childEl)) {
494
+ childEl.remove();
495
+ }
496
+ }
497
+ return codeEl.innerText;
498
+ }
499
+ });
500
+ clipboard.on('success', function(e) {
501
+ // button target
502
+ const button = e.trigger;
503
+ // don't keep focus
504
+ button.blur();
505
+ // flash "checked"
506
+ button.classList.add('code-copy-button-checked');
507
+ var currentTitle = button.getAttribute("title");
508
+ button.setAttribute("title", "Copied!");
509
+ let tooltip;
510
+ if (window.bootstrap) {
511
+ button.setAttribute("data-bs-toggle", "tooltip");
512
+ button.setAttribute("data-bs-placement", "left");
513
+ button.setAttribute("data-bs-title", "Copied!");
514
+ tooltip = new bootstrap.Tooltip(button,
515
+ { trigger: "manual",
516
+ customClass: "code-copy-button-tooltip",
517
+ offset: [0, -8]});
518
+ tooltip.show();
519
+ }
520
+ setTimeout(function() {
521
+ if (tooltip) {
522
+ tooltip.hide();
523
+ button.removeAttribute("data-bs-title");
524
+ button.removeAttribute("data-bs-toggle");
525
+ button.removeAttribute("data-bs-placement");
526
+ }
527
+ button.setAttribute("title", currentTitle);
528
+ button.classList.remove('code-copy-button-checked');
529
+ }, 1000);
530
+ // clear code selection
531
+ e.clearSelection();
532
+ });
533
+ function tippyHover(el, contentFn) {
534
+ const config = {
535
+ allowHTML: true,
536
+ content: contentFn,
537
+ maxWidth: 500,
538
+ delay: 100,
539
+ arrow: false,
540
+ appendTo: function(el) {
541
+ return el.parentElement;
542
+ },
543
+ interactive: true,
544
+ interactiveBorder: 10,
545
+ theme: 'quarto',
546
+ placement: 'bottom-start'
547
+ };
548
+ window.tippy(el, config);
549
+ }
550
+ const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
551
+ for (var i=0; i<noterefs.length; i++) {
552
+ const ref = noterefs[i];
553
+ tippyHover(ref, function() {
554
+ // use id or data attribute instead here
555
+ let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
556
+ try { href = new URL(href).hash; } catch {}
557
+ const id = href.replace(/^#\/?/, "");
558
+ const note = window.document.getElementById(id);
559
+ return note.innerHTML;
560
+ });
561
+ }
562
+ let selectedAnnoteEl;
563
+ const selectorForAnnotation = ( cell, annotation) => {
564
+ let cellAttr = 'data-code-cell="' + cell + '"';
565
+ let lineAttr = 'data-code-annotation="' + annotation + '"';
566
+ const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
567
+ return selector;
568
+ }
569
+ const selectCodeLines = (annoteEl) => {
570
+ const doc = window.document;
571
+ const targetCell = annoteEl.getAttribute("data-target-cell");
572
+ const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
573
+ const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
574
+ const lines = annoteSpan.getAttribute("data-code-lines").split(",");
575
+ const lineIds = lines.map((line) => {
576
+ return targetCell + "-" + line;
577
+ })
578
+ let top = null;
579
+ let height = null;
580
+ let parent = null;
581
+ if (lineIds.length > 0) {
582
+ //compute the position of the single el (top and bottom and make a div)
583
+ const el = window.document.getElementById(lineIds[0]);
584
+ top = el.offsetTop;
585
+ height = el.offsetHeight;
586
+ parent = el.parentElement.parentElement;
587
+ if (lineIds.length > 1) {
588
+ const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
589
+ const bottom = lastEl.offsetTop + lastEl.offsetHeight;
590
+ height = bottom - top;
591
+ }
592
+ if (top !== null && height !== null && parent !== null) {
593
+ // cook up a div (if necessary) and position it
594
+ let div = window.document.getElementById("code-annotation-line-highlight");
595
+ if (div === null) {
596
+ div = window.document.createElement("div");
597
+ div.setAttribute("id", "code-annotation-line-highlight");
598
+ div.style.position = 'absolute';
599
+ parent.appendChild(div);
600
+ }
601
+ div.style.top = top - 2 + "px";
602
+ div.style.height = height + 4 + "px";
603
+ let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
604
+ if (gutterDiv === null) {
605
+ gutterDiv = window.document.createElement("div");
606
+ gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
607
+ gutterDiv.style.position = 'absolute';
608
+ const codeCell = window.document.getElementById(targetCell);
609
+ const gutter = codeCell.querySelector('.code-annotation-gutter');
610
+ gutter.appendChild(gutterDiv);
611
+ }
612
+ gutterDiv.style.top = top - 2 + "px";
613
+ gutterDiv.style.height = height + 4 + "px";
614
+ }
615
+ selectedAnnoteEl = annoteEl;
616
+ }
617
+ };
618
+ const unselectCodeLines = () => {
619
+ const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
620
+ elementsIds.forEach((elId) => {
621
+ const div = window.document.getElementById(elId);
622
+ if (div) {
623
+ div.remove();
624
+ }
625
+ });
626
+ selectedAnnoteEl = undefined;
627
+ };
628
+ // Attach click handler to the DT
629
+ const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
630
+ for (const annoteDlNode of annoteDls) {
631
+ annoteDlNode.addEventListener('click', (event) => {
632
+ const clickedEl = event.target;
633
+ if (clickedEl !== selectedAnnoteEl) {
634
+ unselectCodeLines();
635
+ const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
636
+ if (activeEl) {
637
+ activeEl.classList.remove('code-annotation-active');
638
+ }
639
+ selectCodeLines(clickedEl);
640
+ clickedEl.classList.add('code-annotation-active');
641
+ } else {
642
+ // Unselect the line
643
+ unselectCodeLines();
644
+ clickedEl.classList.remove('code-annotation-active');
645
+ }
646
+ });
647
+ }
648
+ const findCites = (el) => {
649
+ const parentEl = el.parentElement;
650
+ if (parentEl) {
651
+ const cites = parentEl.dataset.cites;
652
+ if (cites) {
653
+ return {
654
+ el,
655
+ cites: cites.split(' ')
656
+ };
657
+ } else {
658
+ return findCites(el.parentElement)
659
+ }
660
+ } else {
661
+ return undefined;
662
+ }
663
+ };
664
+ var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
665
+ for (var i=0; i<bibliorefs.length; i++) {
666
+ const ref = bibliorefs[i];
667
+ const citeInfo = findCites(ref);
668
+ if (citeInfo) {
669
+ tippyHover(citeInfo.el, function() {
670
+ var popup = window.document.createElement('div');
671
+ citeInfo.cites.forEach(function(cite) {
672
+ var citeDiv = window.document.createElement('div');
673
+ citeDiv.classList.add('hanging-indent');
674
+ citeDiv.classList.add('csl-entry');
675
+ var biblioDiv = window.document.getElementById('ref-' + cite);
676
+ if (biblioDiv) {
677
+ citeDiv.innerHTML = biblioDiv.innerHTML;
678
+ }
679
+ popup.appendChild(citeDiv);
680
+ });
681
+ return popup.innerHTML;
682
+ });
683
+ }
684
+ }
685
+ });
686
+ </script>
687
+ </div> <!-- /content -->
688
+
689
+
690
+
691
+ </body></html>
tasks.py CHANGED
@@ -377,7 +377,6 @@ class CMMLU:
377
  ],
378
  "Other": ["other"],
379
  "China specific": ["china specific"],
380
- "Test": ["computer science"],
381
  }
382
 
383
  @classmethod
 
377
  ],
378
  "Other": ["other"],
379
  "China specific": ["china specific"],
 
380
  }
381
 
382
  @classmethod
tlem.py CHANGED
@@ -1,7 +1,4 @@
1
- try:
2
- from ipytorch import logging
3
- except Exception as e:
4
- import logging
5
 
6
  from typing import Any, Optional, Protocol, Iterable, Callable
7
  from tqdm.auto import tqdm
 
1
+ import logging
 
 
 
2
 
3
  from typing import Any, Optional, Protocol, Iterable, Callable
4
  from tqdm.auto import tqdm