Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Load agent evaluation tasks","local":"load-agent-evaluation-tasks","sections":[{"title":"Repository structure","local":"repository-structure","sections":[],"depth":2},{"title":"Load tasks","local":"load-tasks","sections":[],"depth":2},{"title":"Columns","local":"columns","sections":[],"depth":2},{"title":"Filter a benchmark","local":"filter-a-benchmark","sections":[],"depth":2},{"title":"Read the other files of a task","local":"read-the-other-files-of-a-task","sections":[],"depth":2},{"title":"Configuration","local":"configuration","sections":[],"depth":2},{"title":"See also","local":"see-also","sections":[],"depth":2}],"depth":1}"/> | |
| <link href="/docs/datasets/main/en/_app/immutable/entry/start.RJnEiymH.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/CMyXiyFs.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/DEl054mf.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/entry/app.CO3d_rST.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/BThiWKpU.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/BqoKRHZu.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/ClrEmBOw.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/nodes/0.D9GZgf9K.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/LT0FK29p.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/nodes/21.DwZLol8F.js" rel="modulepreload"> | |
| <link href="/docs/datasets/main/en/_app/immutable/chunks/Y07aUP_m.js" rel="modulepreload"> | |
| <!--1g9dz1c--><meta name="hf:doc:metadata" content="{"title":"Load agent evaluation tasks","local":"load-agent-evaluation-tasks","sections":[{"title":"Repository structure","local":"repository-structure","sections":[],"depth":2},{"title":"Load tasks","local":"load-tasks","sections":[],"depth":2},{"title":"Columns","local":"columns","sections":[],"depth":2},{"title":"Filter a benchmark","local":"filter-a-benchmark","sections":[],"depth":2},{"title":"Read the other files of a task","local":"read-the-other-files-of-a-task","sections":[],"depth":2},{"title":"Configuration","local":"configuration","sections":[],"depth":2},{"title":"See also","local":"see-also","sections":[],"depth":2}],"depth":1}"/><!----> | |
| <link href="/docs/datasets/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg><!----></button></div> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="load-agent-evaluation-tasks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#load-agent-evaluation-tasks"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Load agent evaluation tasks</span></h1><!--]--><!----> <p>A <a href="https://harborframework.com/docs" rel="nofollow">Harbor</a> dataset is a collection of <em>tasks</em> used to evaluate AI agents: each | |
| task gives an agent an instruction, a sandboxed environment to work in, and a verifier that scores its work.</p> <p>Unlike tabular datasets, a Harbor dataset isn’t a file with one row per example: <strong>every task is a directory</strong>. | |
| The <code>harbor</code> builder reads such a repository and yields one row per task, so a benchmark can be explored, | |
| filtered and shared like any other dataset:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"harborframework/terminal-bench"</span>) | |
| <span class="hljs-meta">>>> </span>dataset | |
| DatasetDict({ | |
| test: Dataset({ | |
| features: [<span class="hljs-string">'name'</span>, <span class="hljs-string">'instruction'</span>, <span class="hljs-string">'description'</span>, <span class="hljs-string">'keywords'</span>, <span class="hljs-string">'schema_version'</span>, <span class="hljs-string">'config'</span>, <span class="hljs-string">'metadata'</span>, <span class="hljs-string">'files'</span>, <span class="hljs-string">'location'</span>], | |
| num_rows: <span class="hljs-number">66</span> | |
| }) | |
| })<!----></pre></div><!----> <blockquote class="tip"><p>Loading a Harbor dataset only <em>reads</em> the tasks: it never runs an agent, builds an image or executes a | |
| verifier, and it doesn’t require Harbor to be installed. Use the <a href="https://harborframework.com/docs" rel="nofollow">Harbor</a> library to actually run the tasks.</p></blockquote> <blockquote class="warning"><p>Harbor task configurations are TOML files. Python 3.11 and later read them with the standard library | |
| (<code>tomllib</code>); on Python 3.10, you need to install a TOML parser as an extra dependency. Check out the <a href="./installation#harbor">installation</a> guide to learn how to install it.</p></blockquote> <!--[1--><h2 class="relative group"><a id="repository-structure" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#repository-structure"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Repository structure</span></h2><!--]--><!----> <p>A task directory is identified by two files, <code>task.toml</code> and <code>instruction.md</code>, and usually also contains the | |
| environment definition, the verifier and an oracle solution:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-text "><!---->my-harbor-dataset/ | |
| ├── README.md | |
| └── tasks/ | |
| ├── task-a/ | |
| │ ├── task.toml # configuration: metadata, resources, timeouts... | |
| │ ├── instruction.md # what the agent is asked to do | |
| │ ├── README.md # optional human-readable description | |
| │ ├── environment/ # Dockerfile / docker-compose.yaml + files of the sandbox | |
| │ ├── tests/ # verifier | |
| │ └── solution/ # oracle solution | |
| └── task-b/ | |
| └── ...<!----></pre></div><!----> <p>A directory is recognized as a Harbor dataset as soon as one of its sub-directories, however deep, is a task | |
| directory (a <code>task.toml</code> file and an <code>instruction.md</code> file side by side): the tasks are found automatically, | |
| without having to list any file.</p> <!--[1--><h2 class="relative group"><a id="load-tasks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#load-tasks"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Load tasks</span></h2><!--]--><!----> <p>Since Harbor datasets are made of directories rather than of data files, they are loaded by <em>path</em> — no <code>data_files</code> argument:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># a dataset repository on the Hub</span> | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"harborframework/terminal-bench"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># a local directory of tasks</span> | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"/path/to/my-harbor-dataset"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># the tasks of a repository that are in a sub-directory</span> | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"harborframework/terminal-bench"</span>, data_dir=<span class="hljs-string">"tasks"</span>)<!----></pre></div><!----> <p>Passing <code>data_files</code> explicitly is supported too, as long as the pattern includes the <code>task.toml</code> and <code>instruction.md</code> files — one | |
| matched file pair file gives one row:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span>dataset = load_dataset( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"/path/to/my-harbor-dataset"</span>, | |
| <span class="hljs-meta">... </span> data_files={<span class="hljs-string">"test"</span>: [<span class="hljs-string">"my-tasks-dir/*/task.toml"</span>, <span class="hljs-string">"my-tasks-dir/*/instruction.md"</span>]}, | |
| <span class="hljs-meta">... </span>)<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="columns" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#columns"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Columns</span></h2><!--]--><!----> <p>Every row describes one task:</p> <table><thead><tr><th>Column</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td><code>[task].name</code> of <code>task.toml</code> (usually <code>org/name</code>), or the task directory name.</td></tr><tr><td><code>description</code></td><td><code>string</code></td><td><code>[task].description</code> of <code>task.toml</code>.</td></tr><tr><td><code>instruction</code></td><td><code>string</code></td><td>Contents of <code>instruction.md</code>: what the agent has to do.</td></tr><tr><td><code>keywords</code></td><td><code>list</code> of <code>string</code></td><td><code>[task].keywords</code> of <code>task.toml</code>.</td></tr><tr><td><code>schema_version</code></td><td><code>string</code></td><td><code>schema_version</code> declared by <code>task.toml</code>.</td></tr><tr><td><code>config</code></td><td><code>dict</code></td><td>The whole <code>task.toml</code>, as a JSON object: <code>[task]</code>, <code>[metadata]</code>, <code>[verifier]</code>, <code>[agent]</code>, <code>[environment]</code>, <code>[steps]</code>…</td></tr><tr><td><code>metadata</code></td><td><code>dict</code></td><td>The free-form <code>[metadata]</code> section of <code>task.toml</code>.</td></tr><tr><td><code>files</code></td><td><code>list</code> of <code>string</code></td><td>All the files of the task, with paths relative to the task directory.</td></tr><tr><td><code>location</code></td><td><code>string</code></td><td>Location of the task directory in the dataset.</td></tr></tbody></table> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"harborframework/terminal-bench"</span>, split=<span class="hljs-string">"test"</span>) | |
| <span class="hljs-meta">>>> </span>dataset[<span class="hljs-number">0</span>][<span class="hljs-string">"name"</span>] | |
| <span class="hljs-string">'terminal-bench/atrx-vep-crispr'</span> | |
| <span class="hljs-meta">>>> </span>dataset[<span class="hljs-number">0</span>][<span class="hljs-string">"instruction"</span>][:<span class="hljs-number">90</span>] | |
| <span class="hljs-string">'You are provided with a region of genomic DNA representing the human ATRX locus plus sequence'</span> | |
| <span class="hljs-meta">>>> </span>dataset[<span class="hljs-number">0</span>][<span class="hljs-string">"config"</span>][<span class="hljs-string">"task"</span>][<span class="hljs-string">"authors"</span>] | |
| [{<span class="hljs-string">'name'</span>: <span class="hljs-string">'ScaleAI'</span>, <span class="hljs-string">'email'</span>: <span class="hljs-string">'tbench@scale.com'</span>}] | |
| <span class="hljs-meta">>>> </span>dataset[<span class="hljs-number">0</span>][<span class="hljs-string">"metadata"</span>][<span class="hljs-string">"category"</span>] | |
| <span class="hljs-string">'Science'</span> | |
| <span class="hljs-meta">>>> </span>dataset[<span class="hljs-number">0</span>][<span class="hljs-string">"config"</span>][<span class="hljs-string">"environment"</span>] | |
| {<span class="hljs-string">'build_timeout_sec'</span>: <span class="hljs-number">1800.0</span>, <span class="hljs-string">'cpus'</span>: <span class="hljs-number">2</span>, <span class="hljs-string">'memory_mb'</span>: <span class="hljs-number">4096</span>, <span class="hljs-string">'storage_mb'</span>: <span class="hljs-number">10240</span>, <span class="hljs-string">'gpus'</span>: <span class="hljs-number">0</span>} | |
| <span class="hljs-meta">>>> </span>dataset[<span class="hljs-number">0</span>][<span class="hljs-string">"files"</span>][:<span class="hljs-number">4</span>] | |
| [<span class="hljs-string">'LICENSE.md'</span>, <span class="hljs-string">'README.md'</span>, <span class="hljs-string">'environment/Dockerfile'</span>, <span class="hljs-string">'environment/data/CDS-information.txt'</span>] | |
| <span class="hljs-meta">>>> </span>dataset[<span class="hljs-number">0</span>][<span class="hljs-string">"location"</span>] | |
| <span class="hljs-string">'tasks/atrx-vep-crispr'</span><!----></pre></div><!----> <p>The whole <code>task.toml</code> is available in <code>config</code>, so nothing is lost when a task uses fields that aren’t | |
| promoted to their own column:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span>dataset = dataset.<span class="hljs-built_in">map</span>(<span class="hljs-keyword">lambda</span> task: {<span class="hljs-string">"timeout_min"</span>: task[<span class="hljs-string">"config"</span>][<span class="hljs-string">"verifier"</span>][<span class="hljs-string">"timeout_sec"</span>] / <span class="hljs-number">60</span>}) | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">sorted</span>(<span class="hljs-built_in">set</span>(dataset[<span class="hljs-string">"timeout_min"</span>]))[:<span class="hljs-number">6</span>] | |
| [<span class="hljs-number">1.0</span>, <span class="hljs-number">2.0</span>, <span class="hljs-number">3.0</span>, <span class="hljs-number">4.0</span>, <span class="hljs-number">5.0</span>, <span class="hljs-number">7.0</span>]<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="filter-a-benchmark" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#filter-a-benchmark"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Filter a benchmark</span></h2><!--]--><!----> <p>Because the task metadata is loaded as a dictionary, a benchmark can be explored with the usual <a href="/docs/datasets/pr_8521/en/package_reference/main_classes#datasets.Dataset.filter">filter()</a> and <a href="/docs/datasets/pr_8521/en/package_reference/main_classes#datasets.Dataset.map">map()</a> methods:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span>security_tasks = dataset.<span class="hljs-built_in">filter</span>(<span class="hljs-keyword">lambda</span> task: task[<span class="hljs-string">"metadata"</span>].get(<span class="hljs-string">"category"</span>) == <span class="hljs-string">"Security"</span>) | |
| <span class="hljs-meta">>>> </span>[task[<span class="hljs-string">"name"</span>] <span class="hljs-keyword">for</span> task <span class="hljs-keyword">in</span> security_tasks] | |
| [<span class="hljs-string">'terminal-bench/formal-crypto'</span>, <span class="hljs-string">'terminal-bench/html-js-filter'</span>, <span class="hljs-string">'terminal-bench/interleaved-vigenere'</span>, <span class="hljs-string">'terminal-bench/shadow-relay'</span>, <span class="hljs-string">'terminal-bench/uefi-bootkit'</span>]<!----></pre></div><!----> <p>The <code>files</code> column lists everything the task ships, which is handy to look at how a task is verified:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span>pytest_verifiers = dataset.<span class="hljs-built_in">filter</span>(<span class="hljs-keyword">lambda</span> task: <span class="hljs-built_in">any</span>(f.startswith(<span class="hljs-string">"tests/"</span>) <span class="hljs-keyword">and</span> f.endswith(<span class="hljs-string">".py"</span>) <span class="hljs-keyword">for</span> f <span class="hljs-keyword">in</span> task[<span class="hljs-string">"files"</span>])) | |
| <span class="hljs-meta">>>> </span>pytest_verifiers.num_rows | |
| <span class="hljs-number">63</span><!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="read-the-other-files-of-a-task" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#read-the-other-files-of-a-task"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Read the other files of a task</span></h2><!--]--><!----> <p>Only the instruction and the configuration of a task are loaded as columns: its environment, verifier and | |
| solution files are listed in the <code>files</code> column, as paths relative to the task directory. Combine <code>task_id</code> and <code>files</code> to open any of them with <code>fsspec</code>:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hffs | |
| <span class="hljs-meta">>>> </span>dataset_path = <span class="hljs-string">"hf://datasets/harborframework/terminal-bench"</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> hffs.<span class="hljs-built_in">open</span>(<span class="hljs-string">f"<span class="hljs-subst">{dataset_path}</span>/tasks/cumulative-layout-shift/environment/Dockerfile"</span>, <span class="hljs-string">"r"</span>) <span class="hljs-keyword">as</span> f: | |
| <span class="hljs-meta">... </span> <span class="hljs-built_in">print</span>(f.read()[:<span class="hljs-number">20</span>]) | |
| <span class="hljs-string">'# harbor-canary GUID</span><!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="configuration" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#configuration"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Configuration</span></h2><!--]--><!----> <p><a href="/docs/datasets/pr_8521/en/package_reference/loading_methods#datasets.packaged_modules.harbor.HarborConfig">HarborConfig</a> accepts a few arguments on top of the usual <code>load_dataset</code> ones:</p> <ul><li><code>strip_canary</code> (default <code>True</code>): remove the leading “benchmark data canary” comment lines from the | |
| instructions, the same way Harbor does when it sends them to an agent. Set it to <code>False</code> to keep the | |
| original file contents.</li> <li><code>include_files</code> (default <code>True</code>): list all the files of every task in the <code>files</code> column. Set it to <code>False</code> to skip listing the task directories, which is faster when the dataset is on a remote filesystem | |
| or has thousands of files per task.</li></ul> <p>Tasks can also be streamed, which avoids downloading the whole benchmark upfront:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"harborframework/terminal-bench"</span>, streaming=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">for</span> task <span class="hljs-keyword">in</span> dataset[<span class="hljs-string">"test"</span>]: | |
| <span class="hljs-meta">... </span> <span class="hljs-built_in">print</span>(task[<span class="hljs-string">"name"</span>])<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="see-also" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#see-also"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>See also</span></h2><!--]--><!----> <ul><li>The reference documentation of <a href="/docs/datasets/pr_8521/en/package_reference/loading_methods#datasets.packaged_modules.harbor.Harbor">Harbor</a> and <a href="/docs/datasets/pr_8521/en/package_reference/loading_methods#datasets.packaged_modules.harbor.HarborConfig">HarborConfig</a>.</li> <li>The <a href="https://harborframework.com/docs" rel="nofollow">Harbor documentation</a> to <em>run</em> the tasks of a benchmark with agents | |
| and verifiers.</li></ul> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/datasets/blob/main/docs/source/harbor_load.mdx" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg><!----> <span><span class="underline">Update</span> on GitHub</span></a><!----> <p></p><!--]--><!----><!--]--><!--]--><!--]--> <!--[-1--><!--]--><!--]--> | |
| <script> | |
| { | |
| __sveltekit_yqyno6 = { | |
| base: "/docs/datasets/main/en", | |
| assets: "/docs/datasets/main/en" | |
| }; | |
| const element = document.currentScript.parentElement; | |
| Promise.all([ | |
| import("/docs/datasets/main/en/_app/immutable/entry/start.RJnEiymH.js"), | |
| import("/docs/datasets/main/en/_app/immutable/entry/app.CO3d_rST.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 21], | |
| data: [null,null], | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 43.6 kB
- Xet hash:
- e12838421b5685bbbfa9453ad97a6c512ab683a14446510898efcd9e4fb54ad1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.