Buckets:

qgallouedec's picture
download
raw
72.2 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Track&quot;,&quot;local&quot;:&quot;track&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Introduction&quot;,&quot;local&quot;:&quot;introduction&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Initialization&quot;,&quot;local&quot;:&quot;initialization&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Naming your run&quot;,&quot;local&quot;:&quot;naming-your-run&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Grouping runs&quot;,&quot;local&quot;:&quot;grouping-runs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Remote logging (Hugging Face Space or self-hosted server)&quot;,&quot;local&quot;:&quot;remote-logging-hugging-face-space-or-self-hosted-server&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Logging Data&quot;,&quot;local&quot;:&quot;logging-data&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Logging tables&quot;,&quot;local&quot;:&quot;logging-tables&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging reports (Markdown)&quot;,&quot;local&quot;:&quot;logging-reports-markdown&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging images&quot;,&quot;local&quot;:&quot;logging-images&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging videos&quot;,&quot;local&quot;:&quot;logging-videos&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging audio&quot;,&quot;local&quot;:&quot;logging-audio&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging HTML and figures&quot;,&quot;local&quot;:&quot;logging-html-and-figures&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging system metrics&quot;,&quot;local&quot;:&quot;logging-system-metrics&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Finishing a Run&quot;,&quot;local&quot;:&quot;finishing-a-run&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Resuming a Run&quot;,&quot;local&quot;:&quot;resuming-a-run&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Tracking Configuration&quot;,&quot;local&quot;:&quot;tracking-configuration&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/>
<link href="/docs/trackio/v0.34.0/en/_app/immutable/entry/start.qOC3rgkk.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/99SEdJFH.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/c5epZbRJ.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/entry/app.C1IMScd_.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/CTPvGMXu.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/nFfuFHB_.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/CldSabhm.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/nodes/0.B8US0jOa.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/DoyOpfDJ.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/nodes/21.CJktPF4t.js" rel="modulepreload">
<link href="/docs/trackio/v0.34.0/en/_app/immutable/chunks/CYwJY_et.js" rel="modulepreload">
<!--1jzor1s--><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Track&quot;,&quot;local&quot;:&quot;track&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Introduction&quot;,&quot;local&quot;:&quot;introduction&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Initialization&quot;,&quot;local&quot;:&quot;initialization&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Naming your run&quot;,&quot;local&quot;:&quot;naming-your-run&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Grouping runs&quot;,&quot;local&quot;:&quot;grouping-runs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Remote logging (Hugging Face Space or self-hosted server)&quot;,&quot;local&quot;:&quot;remote-logging-hugging-face-space-or-self-hosted-server&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Logging Data&quot;,&quot;local&quot;:&quot;logging-data&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Logging tables&quot;,&quot;local&quot;:&quot;logging-tables&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging reports (Markdown)&quot;,&quot;local&quot;:&quot;logging-reports-markdown&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging images&quot;,&quot;local&quot;:&quot;logging-images&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging videos&quot;,&quot;local&quot;:&quot;logging-videos&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging audio&quot;,&quot;local&quot;:&quot;logging-audio&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging HTML and figures&quot;,&quot;local&quot;:&quot;logging-html-and-figures&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Logging system metrics&quot;,&quot;local&quot;:&quot;logging-system-metrics&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Finishing a Run&quot;,&quot;local&quot;:&quot;finishing-a-run&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Resuming a Run&quot;,&quot;local&quot;:&quot;resuming-a-run&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Tracking Configuration&quot;,&quot;local&quot;:&quot;tracking-configuration&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/><!---->
<link href="/docs/trackio/v0.34.0/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="track" 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="#track"><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>Track</span></h1><!--]--><!----> <!--[1--><h2 class="relative group"><a id="introduction" 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="#introduction"><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>Introduction</span></h2><!--]--><!----> <p>Trackio helps you organize your experiments within a <strong>project</strong>.
A project is a collection of <strong>runs</strong>, where each run represents a single execution of your code with a specific set of parameters and results.</p> <!--[1--><h2 class="relative group"><a id="initialization" 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="#initialization"><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>Initialization</span></h2><!--]--><!----> <p>To start tracking an experiment with Trackio, you first need to initialize a project with the <a href="/docs/trackio/pr_658/en/api#trackio.init">init()</a> function:</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-python "><!----><span class="hljs-keyword">import</span> trackio
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>)<!----></pre></div><!----> <ul><li>If the project already exists, it will be loaded.</li> <li>If not, Trackio will create a new one.</li></ul> <p>In both cases, a new run is started automatically, ready for you to log data.</p> <!--[2--><h3 class="relative group"><a id="naming-your-run" 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="#naming-your-run"><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>Naming your run</span></h3><!--]--><!----> <p>It’s a good idea to give each run a meaningful name for easier organization and later reference.
You can set a name using the <code>name</code> parameter:</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-python "><!---->trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, name=<span class="hljs-string">&quot;my_first_run&quot;</span>)<!----></pre></div><!----> <p>If no name is provided, Trackio generates a default one.</p> <!--[2--><h3 class="relative group"><a id="grouping-runs" 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="#grouping-runs"><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>Grouping runs</span></h3><!--]--><!----> <p>You can organize related runs into groups using the <code>group</code> parameter. This is particularly useful when you’re running multiple experiments with different configurations but want to compare them together:</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-python "><!----><span class="hljs-comment"># Group runs by experiment type</span>
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, name=<span class="hljs-string">&quot;baseline_run_1&quot;</span>, group=<span class="hljs-string">&quot;baseline&quot;</span>)
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, name=<span class="hljs-string">&quot;augmented_run_1&quot;</span>, group=<span class="hljs-string">&quot;augmented&quot;</span>)
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, name=<span class="hljs-string">&quot;tuned_run_1&quot;</span>, group=<span class="hljs-string">&quot;tuned&quot;</span>)<!----></pre></div><!----> <p>Runs with the same group name can be grouped together in sidebar, making it easier to compare related experiments. You can also group runs by any other configuration parameter (see <a href="#tracking-configuration">Tracking Configuration</a> below).</p> <!--[2--><h3 class="relative group"><a id="remote-logging-hugging-face-space-or-self-hosted-server" 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="#remote-logging-hugging-face-space-or-self-hosted-server"><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>Remote logging (Hugging Face Space or self-hosted server)</span></h3><!--]--><!----> <p>By default, metrics are stored locally and you open the dashboard on your machine. You can instead send metrics to:</p> <ul><li>A <strong>Hugging Face Space</strong>, by passing <code>space_id</code> (or setting <code>TRACKIO_SPACE_ID</code>). Trackio can create or reuse the Space and sync data there.</li> <li>A <strong>self-hosted Trackio server</strong> (HTTP or HTTPS), by passing <code>server_url</code> (or setting <code>TRACKIO_SERVER_URL</code>). Use the write-access URL from <code>trackio.show()</code> (optionally with <code>write_token</code> in the query), or a base URL plus <code>TRACKIO_WRITE_TOKEN</code>. The client authenticates with the same <strong>write token</strong> the dashboard uses (not your Hugging Face token).</li></ul> <p>If both a Space and a self-hosted URL are configured (<code>space_id</code> / <code>TRACKIO_SPACE_ID</code> together with <code>server_url</code> / <code>TRACKIO_SERVER_URL</code>), <strong>the Space takes precedence</strong> and the self-hosted URL is ignored. Options such as <code>dataset_id</code> (deprecated; use <code>bucket_id</code> instead) and <code>bucket_id</code> apply to Hugging Face deployments; when only <code>server_url</code> is in effect, configure storage on the host that runs the server (see <a href="environment_variables">Environment Variables</a>).</p> <p>For setup steps (running <code>trackio show</code>, binding to <code>0.0.0.0</code>, write tokens), see <a href="self_hosted_server">Self-host the Server</a>.</p> <p>The built-in dashboard polls for new runs and metrics every <strong>1 second</strong> on localhost and every <strong>2 seconds</strong> when opened on a Hugging Face Space (<code>*.hf.space</code>), to ease rate limits on the Space URL.</p> <!--[1--><h2 class="relative group"><a id="logging-data" 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="#logging-data"><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>Logging Data</span></h2><!--]--><!----> <p>Once your run is initialized, you can start logging data using the <a href="/docs/trackio/pr_658/en/api#trackio.log">log()</a> function:</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-python "><!---->trackio.log({<span class="hljs-string">&quot;loss&quot;</span>: <span class="hljs-number">0.05</span>})<!----></pre></div><!----> <p>Trackio is written defensively so Trackio-side failures should never take down your main experiment code. Under normal usage, issues inside Trackio’s logging, flushing, or delivery paths degrade to warnings and local buffering rather than exceptions from your training loop.</p> <p>Each call to <a href="/docs/trackio/pr_658/en/api#trackio.log">log()</a> automatically increments the step counter.
If you want to log multiple metrics at once, pass them together:</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-python "><!---->trackio.log({
<span class="hljs-string">&quot;loss&quot;</span>: <span class="hljs-number">0.05</span>,
<span class="hljs-string">&quot;accuracy&quot;</span>: <span class="hljs-number">0.95</span>,
})<!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="logging-tables" 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="#logging-tables"><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>Logging tables</span></h3><!--]--><!----> <p>You can log tabular data using the <a href="/docs/trackio/pr_658/en/api#trackio.Table">Table</a> class. This is useful for tracking results like predictions, or any structured data. Tables can include image columns using the <a href="/docs/trackio/pr_658/en/api#trackio.TrackioImage">Image</a> class.</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-python "><!----><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
df = pd.DataFrame(
{
<span class="hljs-string">&quot;prompt&quot;</span>: [<span class="hljs-string">&quot;Trackio&quot;</span>, <span class="hljs-string">&quot;Logging is&quot;</span>],
<span class="hljs-string">&quot;completion&quot;</span>: [<span class="hljs-string">&quot;is great!&quot;</span>, <span class="hljs-string">&quot;easy and fun!&quot;</span>],
<span class="hljs-string">&quot;reward&quot;</span>: [<span class="hljs-number">0.123</span>, <span class="hljs-number">0.456</span>],
}
)
trackio.log(
{
...
<span class="hljs-string">&quot;texts&quot;</span>: trackio.Table(dataframe=df),
}
)<!----></pre></div><!----> <iframe src="https://trackio-documentation.hf.space/?project=log-table&amp;metrics=loss,text&amp;sidebar=hidden" width="600" height="630" style="border:0;"></iframe> <!--[2--><h3 class="relative group"><a id="logging-reports-markdown" 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="#logging-reports-markdown"><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>Logging reports (Markdown)</span></h3><!--]--><!----> <p>You can log markdown reports using the <code>Markdown</code> class. Reports are shown in the <strong>Reports</strong> page in the dashboard, where the newest report appears first.</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-python "><!---->trackio.log(
{
<span class="hljs-string">&quot;training_report&quot;</span>: trackio.Markdown(
<span class="hljs-string">&quot;&quot;&quot;# Training Report
Final validation accuracy: **0.92**
- Best epoch: 18
- Early stopping: enabled
&quot;&quot;&quot;</span>
)
}
)<!----></pre></div><!----> <p>You can log reports multiple times during a run (for example, one report per checkpoint), and Trackio will keep the full history across steps.</p> <p>For a complete runnable script, see <code>examples/training-with-report.py</code>.</p> <!--[2--><h3 class="relative group"><a id="logging-images" 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="#logging-images"><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>Logging images</span></h3><!--]--><!----> <p>You can log images using the <a href="/docs/trackio/pr_658/en/api#trackio.TrackioImage">Image</a> class.</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-python "><!---->trackio.log({<span class="hljs-string">&quot;image&quot;</span>: trackio.Image(value=<span class="hljs-string">&quot;path/to/image.png&quot;</span>, caption=<span class="hljs-string">&quot;Image caption&quot;</span>)})<!----></pre></div><!----> <p>Images can be logged from a path, a numpy array, or a PIL Image.</p> <!--[2--><h3 class="relative group"><a id="logging-videos" 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="#logging-videos"><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>Logging videos</span></h3><!--]--><!----> <p>You can log videos using the <a href="/docs/trackio/pr_658/en/api#trackio.TrackioVideo">Video</a> class.</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-python "><!----><span class="hljs-keyword">import</span> trackio
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-comment"># Create a simple video from numpy array</span>
frames = np.random.randint(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, (<span class="hljs-number">10</span>, <span class="hljs-number">3</span>, <span class="hljs-number">64</span>, <span class="hljs-number">64</span>), dtype=np.uint8)
video = trackio.Video(frames, caption=<span class="hljs-string">&quot;Random video&quot;</span>, fps=<span class="hljs-number">30</span>)
trackio.log({<span class="hljs-string">&quot;my_video&quot;</span>: video})
<span class="hljs-comment"># Create a batch of videos</span>
batch_frames = np.random.randint(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, (<span class="hljs-number">3</span>, <span class="hljs-number">10</span>, <span class="hljs-number">3</span>, <span class="hljs-number">64</span>, <span class="hljs-number">64</span>), dtype=np.uint8)
batch_video = trackio.Video(batch_frames, caption=<span class="hljs-string">&quot;Batch of videos&quot;</span>, fps=<span class="hljs-number">15</span>)
trackio.log({<span class="hljs-string">&quot;batch_videos&quot;</span>: batch_video})
<span class="hljs-comment"># Create video from file path</span>
video = trackio.Video(<span class="hljs-string">&quot;path/to/video.mp4&quot;</span>, caption=<span class="hljs-string">&quot;Video from file&quot;</span>)
trackio.log({<span class="hljs-string">&quot;file_video&quot;</span>: video})<!----></pre></div><!----> <p>Videos can be logged from a file path or a numpy array.</p> <p><strong>Numpy array requirements:</strong></p> <ul><li>Must be of type <code>np.uint8</code> with RGB values in the range <code>[0, 255]</code></li> <li>Shape should be either: <ul><li><code>(frames, channels, height, width)</code> for a single video</li> <li><code>(batch, frames, channels, height, width)</code> for multiple videos (will be tiled into a grid)</li></ul></li></ul> <!--[2--><h3 class="relative group"><a id="logging-audio" 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="#logging-audio"><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>Logging audio</span></h3><!--]--><!----> <p>You can log audio using the <a href="/docs/trackio/pr_658/en/api#trackio.TrackioAudio">Audio</a> class.</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-python "><!----><span class="hljs-keyword">import</span> trackio
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-comment"># Generate a 1-second 440 Hz sine wave (mono)</span>
sr = <span class="hljs-number">16000</span>
t = np.linspace(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, sr, endpoint=<span class="hljs-literal">False</span>)
wave = <span class="hljs-number">0.2</span> * np.sin(<span class="hljs-number">2</span> * np.pi * <span class="hljs-number">440</span> * t)
audio = trackio.Audio(wave, caption=<span class="hljs-string">&quot;A4 sine&quot;</span>, sample_rate=sr, <span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;wav&quot;</span>)
trackio.log({<span class="hljs-string">&quot;tone&quot;</span>: audio})
<span class="hljs-comment"># Stereo from numpy array (shape: samples, 2)</span>
stereo = np.stack([wave, wave], axis=<span class="hljs-number">1</span>)
audio = trackio.Audio(stereo, caption=<span class="hljs-string">&quot;Stereo&quot;</span>, sample_rate=sr, <span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;mp3&quot;</span>)
trackio.log({<span class="hljs-string">&quot;stereo&quot;</span>: audio})
<span class="hljs-comment"># From an existing file</span>
audio = trackio.Audio(<span class="hljs-string">&quot;path/to/audio.wav&quot;</span>, caption=<span class="hljs-string">&quot;From file&quot;</span>)
trackio.log({<span class="hljs-string">&quot;file_audio&quot;</span>: audio})<!----></pre></div><!----> <p>Audio can be logged from a file path or a numpy array.</p> <p><strong>Numpy array requirements:</strong></p> <ul><li>Shape should be either <code>(samples,)</code> for mono or <code>(samples, 2)</code> for stereo</li> <li><code>sample_rate</code> must be provided when logging from a numpy array</li> <li>Values may be float or integer; floats are peak-normalized and converted to 16-bit PCM</li> <li><code>format</code> can be <code>"wav"</code> or <code>"mp3"</code> when logging from a numpy array (default <code>"wav"</code>)</li></ul> <!--[2--><h3 class="relative group"><a id="logging-html-and-figures" 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="#logging-html-and-figures"><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>Logging HTML and figures</span></h3><!--]--><!----> <p>You can log HTML using the <a href="/docs/trackio/pr_658/en/api#trackio.TrackioHtml">Html</a> class.</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-python "><!---->trackio.log({<span class="hljs-string">&quot;report&quot;</span>: trackio.Html(<span class="hljs-string">&quot;&lt;h1&gt;Results&lt;/h1&gt;&quot;</span>)})<!----></pre></div><!----> <p>Matplotlib and Plotly figures are converted to HTML:</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-python "><!----><span class="hljs-keyword">import</span> plotly.express <span class="hljs-keyword">as</span> px
fig = px.line(x=[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>], y=[<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>])
trackio.log({<span class="hljs-string">&quot;plot&quot;</span>: fig})<!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="logging-system-metrics" 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="#logging-system-metrics"><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>Logging system metrics</span></h3><!--]--><!----> <p>Trackio can automatically log system metrics in the background. It supports both NVIDIA GPUs and Apple Silicon (M-series) Macs.</p> <p><strong>Installation:</strong></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-bash "><!----><span class="hljs-comment"># NVIDIA GPU monitoring</span>
pip install trackio[gpu]
<span class="hljs-comment"># Apple Silicon system monitoring</span>
pip install trackio[apple-gpu]<!----></pre></div><!----> <p><strong>Automatic logging (default):</strong></p> <p>When the appropriate package is installed and compatible hardware is detected, system metrics are logged automatically in the background (every 10 seconds by default):</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-python "><!----><span class="hljs-keyword">import</span> trackio
<span class="hljs-comment"># Auto-enabled when hardware is detected</span>
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>)
<span class="hljs-keyword">for</span> step <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">100</span>):
<span class="hljs-comment"># ... training code ...</span>
trackio.log({<span class="hljs-string">&quot;loss&quot;</span>: loss})
<span class="hljs-comment"># System metrics are logged automatically in the background</span>
trackio.finish()<!----></pre></div><!----> <p>You can customize the interval or disable auto-logging:</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-python "><!----><span class="hljs-comment"># Custom interval</span>
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, gpu_log_interval=<span class="hljs-number">5.0</span>)
<span class="hljs-comment"># Disable auto-logging</span>
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, auto_log_gpu=<span class="hljs-literal">False</span>)<!----></pre></div><!----> <p><strong>Manual logging:</strong></p> <p>You can also log system metrics manually at specific times using <a href="/docs/trackio/pr_658/en/api#trackio.log_gpu">log_gpu()</a>:</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-python "><!----><span class="hljs-keyword">import</span> trackio
trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, auto_log_gpu=<span class="hljs-literal">False</span>)
<span class="hljs-keyword">for</span> step <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">100</span>):
<span class="hljs-comment"># ... training code ...</span>
trackio.log({<span class="hljs-string">&quot;loss&quot;</span>: loss})
trackio.log_gpu() <span class="hljs-comment"># Log system metrics at current time</span>
trackio.finish()<!----></pre></div><!----> <p><strong>NVIDIA GPU metrics:</strong></p> <p>Per-GPU metrics (<code>gpu/{i}/{metric}</code>):</p> <ul><li><code>gpu/0/utilization</code> - GPU utilization %</li> <li><code>gpu/0/memory_utilization</code> - Memory controller utilization %</li> <li><code>gpu/0/allocated_memory</code> - Memory allocated in GiB</li> <li><code>gpu/0/total_memory</code> - Total memory in GiB</li> <li><code>gpu/0/memory_usage</code> - Memory usage ratio (0-1)</li> <li><code>gpu/0/temp</code> - Temperature in Celsius</li> <li><code>gpu/0/power</code> - Power draw in watts</li> <li><code>gpu/0/power_percent</code> - Power as % of limit</li> <li><code>gpu/0/power_limit</code> - Power limit in watts</li> <li><code>gpu/0/sm_clock</code> - SM clock speed in MHz</li> <li><code>gpu/0/memory_clock</code> - Memory clock speed in MHz</li> <li><code>gpu/0/fan_speed</code> - Fan speed %</li> <li><code>gpu/0/performance_state</code> - Performance state (P0-P15)</li> <li><code>gpu/0/energy_consumed</code> - Energy consumed since run start in Joules</li> <li><code>gpu/0/pcie_tx</code> - PCIe transmit bandwidth in MB/s</li> <li><code>gpu/0/pcie_rx</code> - PCIe receive bandwidth in MB/s</li> <li><code>gpu/0/throttle_thermal</code> - Thermal throttling (0/1)</li> <li><code>gpu/0/throttle_power</code> - Power throttling (0/1)</li> <li><code>gpu/0/throttle_hw_slowdown</code> - Hardware slowdown (0/1)</li> <li><code>gpu/0/throttle_apps</code> - Application clock throttling (0/1)</li> <li><code>gpu/0/corrected_memory_errors</code> - ECC corrected errors</li> <li><code>gpu/0/uncorrected_memory_errors</code> - ECC uncorrected errors</li></ul> <p>Aggregated metrics:</p> <ul><li><code>gpu/mean_utilization</code> - Mean GPU utilization across all GPUs</li> <li><code>gpu/total_allocated_memory</code> - Total memory used across all GPUs in GiB</li> <li><code>gpu/total_power</code> - Total power draw across all GPUs</li> <li><code>gpu/max_temp</code> - Maximum temperature across all GPUs</li></ul> <p><strong>Apple Silicon metrics:</strong></p> <ul><li><code>cpu/utilization</code> - Overall CPU utilization %</li> <li><code>cpu/{i}/utilization</code> - Per-core CPU utilization %</li> <li><code>cpu/frequency</code> - Current CPU frequency in MHz</li> <li><code>cpu/frequency_max</code> - Maximum CPU frequency in MHz</li> <li><code>memory/used</code> - Memory used in GiB</li> <li><code>memory/total</code> - Total memory in GiB</li> <li><code>memory/available</code> - Available memory in GiB</li> <li><code>memory/percent</code> - Memory usage %</li> <li><code>swap/used</code> - Swap used in GiB</li> <li><code>swap/total</code> - Total swap in GiB</li> <li><code>swap/percent</code> - Swap usage %</li> <li><code>temp/{label}</code> - Temperature sensor readings in Celsius (if available)</li> <li><code>gpu/detected</code> - Whether an Apple GPU was detected (0/1)</li></ul> <!--[1--><h2 class="relative group"><a id="finishing-a-run" 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="#finishing-a-run"><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>Finishing a Run</span></h2><!--]--><!----> <p>When your run is complete, finalize it with <a href="/docs/trackio/pr_658/en/api#trackio.finish">finish()</a>.
This marks the run as completed and saves all logged data:</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-python "><!---->trackio.finish()<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="resuming-a-run" 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="#resuming-a-run"><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>Resuming a Run</span></h2><!--]--><!----> <p>Trackio identifies runs internally by a stable <code>run_id</code>. The human-readable <code>name</code> is no longer required to be unique, so you can create multiple runs with the same
display name.</p> <p>If you need to continue the latest run with a given name (for example, after an
interruption), call <a href="/docs/trackio/pr_658/en/api#trackio.init">init()</a> again with the same project and run name, and set <code>resume="must"</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-python "><!---->trackio.init(project=<span class="hljs-string">&quot;my_project&quot;</span>, name=<span class="hljs-string">&quot;my_first_run&quot;</span>, resume=<span class="hljs-string">&quot;must&quot;</span>)<!----></pre></div><!----> <p>This will load the most recently created run with that name so you can keep
logging data using the same <code>run_id</code>. But if you set <code>resume="must"</code>, and no previous run exists with the same name, Trackio will raise an error.</p> <p>For more flexibility, use <code>resume="allow"</code>. This will resume the latest run with
that name if one exists, or create a new run otherwise.</p> <p>The default is <code>resume="never"</code>, which always creates a fresh run with a new <code>run_id</code>, even if another run with the same <code>name</code> already exists.</p> <!--[1--><h2 class="relative group"><a id="tracking-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="#tracking-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>Tracking Configuration</span></h2><!--]--><!----> <p>You can also track configuration parameters for your runs. This is useful for keeping track of hyperparameters or other settings used in your experiments. You can log configuration data using the <code>config</code> parameter in the <a href="/docs/trackio/pr_658/en/api#trackio.init">init()</a> function:</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-python "><!----><span class="hljs-keyword">for</span> batch_size <span class="hljs-keyword">in</span> [<span class="hljs-number">16</span>, <span class="hljs-number">32</span>, <span class="hljs-number">64</span>]:
<span class="hljs-keyword">for</span> lr <span class="hljs-keyword">in</span> [<span class="hljs-number">0.001</span>, <span class="hljs-number">0.01</span>, <span class="hljs-number">0.1</span>]:
trackio.init(
project=<span class="hljs-string">&quot;hyperparameter_tuning&quot;</span>,
name=<span class="hljs-string">f&quot;lr_<span class="hljs-subst">{lr}</span>_batch_<span class="hljs-subst">{batch_size}</span>_run&quot;</span>,
config={
<span class="hljs-string">&quot;learning_rate&quot;</span>: lr,
<span class="hljs-string">&quot;batch_size&quot;</span>: batch_size,
}
)
<span class="hljs-comment"># ... your training code ...</span>
trackio.finish()<!----></pre></div><!----> <p>In the dashboard, you can then group by “learning_rate” or “batch_size” to more easily compare runs with different hyperparameters.</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/gradio-app/trackio/blob/main/docs/source/track.md" 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_koazbp = {
base: "/docs/trackio/v0.34.0/en",
assets: "/docs/trackio/v0.34.0/en"
};
const element = document.currentScript.parentElement;
Promise.all([
import("/docs/trackio/v0.34.0/en/_app/immutable/entry/start.qOC3rgkk.js"),
import("/docs/trackio/v0.34.0/en/_app/immutable/entry/app.C1IMScd_.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 21],
data: [null,null],
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
72.2 kB
·
Xet hash:
e9799184c3fc05c550fb5b11d989de9ace109a96dd9dfd61de98126a08dcca09

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.