Buckets:

qgallouedec's picture
download
raw
78.4 kB
import"../chunks/DsnmJJEf.js";import{aG as ho,s as ee,i as uo,h as go,C as bo,H as r,aH as a,E as vo,a as b}from"../chunks/DGYuDBkl.js";import{p as We,o as qe,e as yo,t as fo,a as d,c as Fe,$ as _o,s as e,d as x,g as o,r as t,h as ko,i as j,j as wo,k as To,f as h,n}from"../chunks/BA8oMRef.js";import{s as Mo}from"../chunks/BoBcZwWf.js";import{b as jo}from"../chunks/7mH5W6P6.js";var xo=x('<div class="relative group rounded-md"><a class="header-link block pr-0.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"><span><!></span></a> <!></div>');function v(U,u){We(u,!0);const _="bg-yellow-50 dark:bg-[#494a3d]";let m=To(void 0);function k(){const{hash:f}=window.location,T=f.substring(1);j(m)&&j(m).classList.remove(..._.split(" ")),T===u.anchor&&j(m).classList.add(..._.split(" "))}qe(()=>{k()});var g=xo();yo("hashchange",_o,k);var l=o(g),w=o(l),M=o(w);ho(M,{classNames:"text-smd"}),t(w),t(l);var N=e(l,2);Mo(N,()=>u.children??ko),t(g),jo(g,f=>wo(m,f),()=>j(m)),fo(()=>{ee(l,"id",u.anchor),ee(l,"href",`#${u.anchor}`)}),d(U,g),Fe()}const Uo='{"title":"API Reference","local":"api-reference","sections":[{"title":"Run","local":"trackio.Run","sections":[],"depth":2},{"title":"init","local":"trackio.init","sections":[],"depth":2},{"title":"log","local":"trackio.log","sections":[],"depth":2},{"title":"log_gpu","local":"trackio.log_gpu","sections":[],"depth":2},{"title":"log_system","local":"trackio.log_system","sections":[],"depth":2},{"title":"log_artifact","local":"trackio.log_artifact","sections":[],"depth":2},{"title":"use_artifact","local":"trackio.use_artifact","sections":[],"depth":2},{"title":"finish","local":"trackio.finish","sections":[],"depth":2},{"title":"show","local":"trackio.show","sections":[],"depth":2},{"title":"sync","local":"trackio.sync","sections":[],"depth":2},{"title":"freeze","local":"trackio.freeze","sections":[],"depth":2},{"title":"delete_project","local":"trackio.delete_project","sections":[],"depth":2},{"title":"import_csv","local":"trackio.import_csv","sections":[],"depth":2},{"title":"import_tf_events","local":"trackio.import_tf_events","sections":[],"depth":2},{"title":"save","local":"trackio.save","sections":[],"depth":2},{"title":"Artifact","local":"trackio.Artifact","sections":[],"depth":2},{"title":"Image","local":"trackio.TrackioImage","sections":[],"depth":2},{"title":"Video","local":"trackio.TrackioVideo","sections":[],"depth":2},{"title":"Audio","local":"trackio.TrackioAudio","sections":[],"depth":2},{"title":"Html","local":"trackio.TrackioHtml","sections":[],"depth":2},{"title":"Table","local":"trackio.Table","sections":[],"depth":2},{"title":"Histogram","local":"trackio.Histogram","sections":[],"depth":2}],"depth":1}';var No=x('<meta name="hf:doc:metadata"/>'),y=x("<p>Example:</p> <!>",1),Io=x(`<p></p> <!> <!> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Resolve an artifact and record this run as a consumer of it.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Creates a new Trackio project and returns a [<em>Run</em>] object.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Logs metrics to the current run.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Log GPU metrics to the current or specified run as system metrics.
Automatically detects whether an NVIDIA or Apple GPU is available and calls
the appropriate logging method.</p> <!></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Logs system metrics (GPU, etc.) to the current run using timestamps instead of steps.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Logs an artifact as an output of the current run.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Fetches an artifact and records it as an input to the current run.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Finishes the current run.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Launches the Trackio dashboard.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Syncs a local Trackio project’s database to a Hugging Face Space.
If the Space does not exist, it will be created. Local data is never deleted.</p> <p><strong>Freezing:</strong> Passing <code>sdk="static"</code> deploys a static Space backed by an HF Bucket
(read-only dashboard, no Gradio server). You can sync the same project again later to
refresh that static Space. If you want a one-time snapshot of an existing Gradio Space,
use <code>freeze()</code> instead.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Creates a new static Hugging Face Space containing a read-only snapshot of
the data for the specified project from the source Gradio Space. The data is
read from the bucket attached to the source Space at freeze time. The original
Space is not modified, and the new static Space does not automatically reflect
metrics uploaded to the original Gradio Space after the freeze completes.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Deletes a project by removing its local SQLite database.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Imports a CSV file into a Trackio project. The CSV file must contain a <code>"step"</code> column, may optionally contain a <code>"timestamp"</code> column, and any other columns will be
treated as metrics. It should also include a header row with the column names.</p> <p>TODO: call init() and return a Run object so that the user can continue to log metrics to it.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Imports TensorFlow Events files from a directory into a Trackio project. Each
subdirectory in the log directory will be imported as a separate run.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Saves files to a project (not linked to a specific run). If Trackio is running
locally, the file(s) will be copied to the project’s files directory. If Trackio is
running in a Space, the file(s) will be uploaded to the Space’s files directory.</p> <!></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>A versioned, named bundle of files and references attached to a project.</p> <p>Construct an <code>Artifact</code>, add files to it with <code>add_file</code> / <code>add_dir</code> (bytes staged into content-addressed storage) or <code>add_reference</code> (an
external URI recorded without copying any bytes), then persist it with <code>trackio.log_artifact</code>. Logging freezes the artifact and populates its
read-only <code>version</code>, <code>aliases</code>, <code>size</code>, and <code>manifest</code>.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Stage every regular file under a directory, recursively.</p> <p>Symlinks are skipped.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Stage a single file for inclusion in the artifact.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Stage a reference to external data, without copying any bytes.</p> <p>Unlike <code>add_file</code>/<code>add_dir</code>, a reference records the data’s URI (plus,
when available, a size and checksum) <em>without staging the bytes into
the content-addressed store</em>. This is how you version and track
lineage over large or already-durably-stored datasets that must not be
duplicated.</p> <p>A URI that denotes a directory (<code>file://</code>, <code>hf://</code>, or a prefix
expanded by a custom handler) is expanded into one entry per object,
capped by <code>max_objects</code>. Reference bytes are never uploaded to a Space
or bucket.</p> <p>The URI is stored verbatim in the artifact manifest, and manifests may
be synced to a shared Hugging Face Dataset — so a signed URI triggers a
warning for security reasons; please prefer the object’s canonical
unsigned URI (e.g. <code>s3://bucket/key</code>).</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Materialize the artifact’s files into a local directory.</p> <p>Files are copied from Trackio’s content-addressed cache (and fetched
from the remote when missing locally), so repeated calls are cheap and
idempotent.</p> <p>Reference entries added via <code>add_reference</code> are fetched here too: the
object at each reference URI is downloaded into the directory (via the
bundled <code>httpx</code> for <code>http(s)://</code>, <code>huggingface_hub</code> for <code>hf://</code>, and
the registered custom <code>ReferenceHandler</code> for any other scheme). Each
object is written atomically and calls are idempotent. Because reference digests
are opaque (a provider ETag or the URI itself), a present file is assumed
current and is not re-verified against the source, and a source whose
re-probed checksum no longer matches the recorded one is downloaded
anyway with a warning. Downloading can transfer a large amount of data;
to work with the URIs without downloading, read them from the <code>references</code> property or <code>get_entry_uri</code> instead. A missing source, an unreachable
server, or a scheme with no registered handler raises.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Return the URI recorded for the reference entry at logical path <code>name</code>, or None if there is no reference entry with that name.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>No-op: trackio logs artifacts synchronously, so the artifact is
already committed by the time <code>log_artifact</code> returns.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Initializes an Image object.</p> <!></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Initializes a Video object.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>RGB uint8 only, shape (F, H, W, 3).</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Initializes an Audio object.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Convert input audio array to contiguous int16 PCM.
Peak normalization is applied to floating inputs.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Initializes an Html object.</p> <!></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Initializes a Table object.</p> <p>Tables can be used to log tabular data including images, numbers, and text.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Converts stored table data to display format for UI rendering.</p> <p>Note:
This does not use the <code>self.data</code> attribute, but instead uses the <code>table_data</code> parameter, which is what the UI receives.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Histogram data type for Trackio, compatible with wandb.Histogram.</p> <!></div> <!> <p></p>`,1);function Bo(U,u){We(u,!1),qe(()=>{new URLSearchParams(window.location.search).get("fw")}),uo();var _=Io();go("ztmkmn",s=>{var p=No();ee(p,"content",Uo),d(s,p)});var m=e(h(_),2);bo(m,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var k=e(m,2);r(k,{title:"API Reference",local:"api-reference",headingTag:"h1"});var g=e(k,2);r(g,{title:"Run",local:"trackio.Run",headingTag:"h2"});var l=e(g,2),w=o(l);a(w,{name:"class trackio.Run",anchor:"trackio.Run",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/run.py#L42",parameters:[{name:"url",val:": str | None"},{name:"project",val:": str"},{name:"client",val:": typing.Optional[typing.Any]"},{name:"name",val:": str | None = None"},{name:"run_id",val:": str | None = None"},{name:"group",val:": str | None = None"},{name:"config",val:": dict | None = None"},{name:"space_id",val:": str | None = None"},{name:"bucket_id",val:": str | None = None"},{name:"server_base_url",val:": str | None = None"},{name:"write_token",val:": str | None = None"},{name:"existing_runs",val:": list[str] | None = None"},{name:"initial_last_step",val:": int | None = None"},{name:"auto_log_gpu",val:": bool = False"},{name:"gpu_log_interval",val:": float = 10.0"},{name:"auto_log_cpu",val:": bool = False"},{name:"cpu_log_interval",val:": float = 10.0"},{name:"webhook_url",val:": str | None = None"},{name:"webhook_min_level",val:": trackio.alerts.AlertLevel | str | None = None"}]});var M=e(w,2),N=o(M);a(N,{name:"use_artifact",anchor:"trackio.Run.use_artifact",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/run.py#L1379",parameters:[{name:"artifact_or_name",val:": trackio.artifact.Artifact | str"},{name:"type",val:": str | None = None"}]}),n(2),t(M),t(l);var f=e(l,2);r(f,{title:"init",local:"trackio.init",headingTag:"h2"});var T=e(f,2),De=o(T);a(De,{name:"trackio.init",anchor:"trackio.init",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L236",parameters:[{name:"project",val:": str"},{name:"name",val:": str | None = None"},{name:"group",val:": str | None = None"},{name:"space_id",val:": str | None = None"},{name:"server_url",val:": str | None = None"},{name:"space_storage",val:": huggingface_hub._space_api.SpaceStorage | None = None"},{name:"dataset_id",val:": str | None = None"},{name:"bucket_id",val:": str | None = None"},{name:"config",val:": dict | None = None"},{name:"resume",val:": str = 'never'"},{name:"settings",val:": typing.Any = None"},{name:"private",val:": bool | None = None"},{name:"embed",val:": bool = True"},{name:"auto_log_gpu",val:": bool | None = None"},{name:"gpu_log_interval",val:": float = 10.0"},{name:"auto_log_cpu",val:": bool | None = None"},{name:"cpu_log_interval",val:": float = 10.0"},{name:"webhook_url",val:": str | None = None"},{name:"webhook_min_level",val:": trackio.alerts.AlertLevel | str | None = None"}],parametersDescription:[{anchor:"trackio.init.project",description:`<strong>project</strong> (<em>str</em>) &#x2014;
The name of the project (can be an existing project to continue tracking or
a new project to start tracking from scratch).`,name:"project"},{anchor:"trackio.init.name",description:`<strong>name</strong> (<em>str</em>, <em>optional</em>) &#x2014;
The name of the run (if not provided, a default name will be generated).`,name:"name"},{anchor:"trackio.init.group",description:`<strong>group</strong> (<em>str</em>, <em>optional</em>) &#x2014;
The name of the group which this run belongs to in order to help organize
related runs together. You can toggle the entire group&#x2019;s visibility in the
dashboard.`,name:"group"},{anchor:"trackio.init.space_id",description:`<strong>space_id</strong> (<em>str</em>, <em>optional</em>) &#x2014;
If provided, the project will be logged to a Hugging Face Space instead of
a local directory. Should be a complete Space name like
<em>&#x201C;username/reponame&#x201D;</em> or <em>&#x201C;orgname/reponame&#x201D;</em>, or just <em>&#x201C;reponame&#x201D;</em> in which
case the Space will be created in the currently-logged-in Hugging Face
user&#x2019;s namespace. If the Space does not exist, it will be created. If the
Space already exists, the project will be logged to it. Can also be set
via the <em>TRACKIO_SPACE_ID</em> environment variable. You cannot log to a
Space that has been <strong>frozen</strong> (converted to the static SDK); use
<code>trackio.sync(..., sdk=&quot;static&quot;)</code> only after you are done logging.
Takes precedence over <em>server_url</em> and <em>TRACKIO_SERVER_URL</em> when more than
one is set.`,name:"space_id"},{anchor:"trackio.init.server_url",description:`<strong>server_url</strong> (<em>str</em>, <em>optional</em>) &#x2014;
Base URL of a self-hosted Trackio server (<code>http://</code> or <code>https://</code>), or the
write-access URL from <code>trackio.show()</code> which may include a <code>write_token</code> query
parameter. The client sends that token on each request (<code>X-Trackio-Write-Token</code>);
you can also set <code>TRACKIO_WRITE_TOKEN</code> instead of embedding the token in the URL.
When set, metrics are sent to that server over HTTP instead of creating or syncing
to a Hugging Face Space. Can also be set via the <code>TRACKIO_SERVER_URL</code> environment
variable. Ignored when <code>space_id</code> or <code>TRACKIO_SPACE_ID</code> is set.`,name:"server_url"},{anchor:"trackio.init.space_storage",description:`<strong>space_storage</strong> ([<em>~huggingface_hub.SpaceStorage</em>], <em>optional</em>) &#x2014;
Choice of persistent storage tier.`,name:"space_storage"},{anchor:"trackio.init.dataset_id",description:`<strong>dataset_id</strong> (<em>str</em>, <em>optional</em>) &#x2014;
Deprecated: persisting trackio data to a Hugging Face Dataset will be
removed in a future version of trackio. Use <em>bucket_id</em> (a Hugging
Face Bucket) instead.`,name:"dataset_id"},{anchor:"trackio.init.bucket_id",description:`<strong>bucket_id</strong> (<em>str</em>, <em>optional</em>) &#x2014;
The ID of the Hugging Face Bucket to use for metric persistence. By default,
when a <em>space_id</em> is provided and <em>bucket_id</em> is not explicitly set, a
bucket is auto-generated from the space_id. Buckets provide
S3-like storage without git overhead - the SQLite database is stored directly
via <em>hf-mount</em> in the Space. Specify a Bucket with name like
<em>&#x201C;username/bucketname&#x201D;</em> or just <em>&#x201C;bucketname&#x201D;</em>.`,name:"bucket_id"},{anchor:"trackio.init.config",description:`<strong>config</strong> (<em>dict</em>, <em>optional</em>) &#x2014;
A dictionary of configuration options. Provided for compatibility with
<em>wandb.init()</em>.`,name:"config"},{anchor:"trackio.init.resume",description:`<strong>resume</strong> (<em>str</em>, <em>optional</em>, defaults to <em>&#x201C;never&#x201D;</em>) &#x2014;
Controls how to handle resuming a run. Can be one of:</p>
<ul>
<li><em>&#x201C;must&#x201D;</em>: Must resume the run with the given name, raises error if run
doesn&#x2019;t exist</li>
<li><em>&#x201C;allow&#x201D;</em>: Resume the run if it exists, otherwise create a new run</li>
<li><em>&#x201C;never&#x201D;</em>: Never resume a run, always create a new one</li>
</ul>`,name:"resume"},{anchor:"trackio.init.private",description:`<strong>private</strong> (<em>bool</em>, <em>optional</em>) &#x2014;
Whether to make the Space private. If None (default), the repo will be
public unless the organization&#x2019;s default is private. This value is ignored
if the repo already exists.`,name:"private"},{anchor:"trackio.init.settings",description:`<strong>settings</strong> (<em>Any</em>, <em>optional</em>) &#x2014;
Not used. Provided for compatibility with <em>wandb.init()</em>.`,name:"settings"},{anchor:"trackio.init.embed",description:`<strong>embed</strong> (<em>bool</em>, <em>optional</em>, defaults to <em>True</em>) &#x2014;
If running inside a Jupyter/Colab notebook, whether the dashboard should
automatically be embedded in the cell when trackio.init() is called. For
local runs, this launches a local Trackio dashboard and embeds it. For Space runs,
this embeds the Space URL. In Colab, the local dashboard will be accessible
via a public share URL when <em>share=True</em>.`,name:"embed"},{anchor:"trackio.init.auto_log_gpu",description:`<strong>auto_log_gpu</strong> (<em>bool</em> or <em>None</em>, <em>optional</em>, defaults to <em>None</em>) &#x2014;
Controls automatic GPU metrics logging. If <em>None</em> (default), GPU logging
is automatically enabled when <em>nvidia-ml-py</em> is installed and an NVIDIA
GPU or Apple M series is detected. Set to <em>True</em> to force enable or
<em>False</em> to disable.`,name:"auto_log_gpu"},{anchor:"trackio.init.gpu_log_interval",description:`<strong>gpu_log_interval</strong> (<em>float</em>, <em>optional</em>, defaults to <em>10.0</em>) &#x2014;
The interval in seconds between automatic GPU metric logs.
Only used when <em>auto_log_gpu=True</em>.`,name:"gpu_log_interval"},{anchor:"trackio.init.auto_log_cpu",description:`<strong>auto_log_cpu</strong> (<em>bool</em> or <em>None</em>, <em>optional</em>, defaults to <em>None</em>) &#x2014;
Controls automatic CPU and RAM metrics logging (utilization, memory,
disk I/O, network I/O, and sensors). If <em>None</em> (default), CPU logging
is automatically enabled when <em>psutil</em> is installed. Set to <em>True</em> to
force enable or <em>False</em> to disable.`,name:"auto_log_cpu"},{anchor:"trackio.init.cpu_log_interval",description:`<strong>cpu_log_interval</strong> (<em>float</em>, <em>optional</em>, defaults to <em>10.0</em>) &#x2014;
The interval in seconds between automatic CPU metric logs.
Only used when CPU auto-logging is enabled.`,name:"cpu_log_interval"},{anchor:"trackio.init.webhook_url",description:`<strong>webhook_url</strong> (<em>str</em>, <em>optional</em>) &#x2014;
A webhook URL to POST alert payloads to when <em>trackio.alert()</em> is
called. Supports Slack and Discord webhook URLs natively (payloads
are formatted automatically). Can also be set via the
<em>TRACKIO_WEBHOOK_URL</em> environment variable. Individual alerts can
override this URL by passing <em>webhook_url</em> to <em>trackio.alert()</em>.`,name:"webhook_url"},{anchor:"trackio.init.webhook_min_level",description:`<strong>webhook_min_level</strong> (<em>AlertLevel</em> or <em>str</em>, <em>optional</em>) &#x2014;
Minimum alert level that should trigger webhook delivery.
For example, <em>AlertLevel.WARN</em> sends only <em>WARN</em> and <em>ERROR</em>
alerts to the webhook destination. Can also be set via
<em>TRACKIO_WEBHOOK_MIN_LEVEL</em>.`,name:"webhook_min_level"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A [<em>Run</em>] object that can be used to log metrics and finish the run.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><em>Run</em></p>
`}),n(2),t(T);var oe=e(T,2);r(oe,{title:"log",local:"trackio.log",headingTag:"h2"});var I=e(oe,2),Ee=o(I);a(Ee,{name:"trackio.log",anchor:"trackio.log",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L682",parameters:[{name:"metrics",val:": dict"},{name:"step",val:": int | None = None"}],parametersDescription:[{anchor:"trackio.log.metrics",description:`<strong>metrics</strong> (<code>dict</code>) &#x2014;
A dictionary of metrics to log.`,name:"metrics"},{anchor:"trackio.log.step",description:`<strong>step</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The step number. If not provided, the step will be incremented
automatically.`,name:"step"}]}),n(2),t(I);var te=e(I,2);r(te,{title:"log_gpu",local:"trackio.log_gpu",headingTag:"h2"});var J=e(te,2),ae=o(J);a(ae,{name:"trackio.log_gpu",anchor:"trackio.log_gpu",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L778",parameters:[{name:"run",val:": trackio.run.Run | None = None"},{name:"device",val:": int | None = None"}],parametersDescription:[{anchor:"trackio.log_gpu.run",description:"<strong>run</strong> &#x2014; Optional Run instance. If None, uses current run from context.",name:"run"},{anchor:"trackio.log_gpu.device",description:`<strong>device</strong> &#x2014; CUDA device index to collect metrics from (NVIDIA GPUs only).
If None, collects from all GPUs visible to this process.
This parameter is ignored for Apple GPUs.`,name:"device"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The GPU metrics that were logged.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p>dict</p>
`});var Ge=e(ae,4);v(Ge,{anchor:"trackio.log_gpu.example",children:(s,p)=>{var i=y(),c=e(h(i),2);b(c,{code:"aW1wb3J0JTIwdHJhY2tpbyUwQSUwQXJ1biUyMCUzRCUyMHRyYWNraW8uaW5pdChwcm9qZWN0JTNEJTIybXktcHJvamVjdCUyMiklMEF0cmFja2lvLmxvZyglN0IlMjJsb3NzJTIyJTNBJTIwMC41JTdEKSUwQXRyYWNraW8ubG9nX2dwdSgpJTBBdHJhY2tpby5sb2dfZ3B1KGRldmljZSUzRDAp",highlighted:`<span class="hljs-keyword">import</span> trackio
run = trackio.init(project=<span class="hljs-string">&quot;my-project&quot;</span>)
trackio.log({<span class="hljs-string">&quot;loss&quot;</span>: <span class="hljs-number">0.5</span>})
trackio.log_gpu()
trackio.log_gpu(device=<span class="hljs-number">0</span>)`,lang:"python",wrap:!1}),d(s,i)},$$slots:{default:!0}}),t(J);var re=e(J,2);r(re,{title:"log_system",local:"trackio.log_system",headingTag:"h2"});var S=e(re,2),Ze=o(S);a(Ze,{name:"trackio.log_system",anchor:"trackio.log_system",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L702",parameters:[{name:"metrics",val:": dict"}],parametersDescription:[{anchor:"trackio.log_system.metrics",description:`<strong>metrics</strong> (<code>dict</code>) &#x2014;
A dictionary of system metrics to log.`,name:"metrics"}]}),n(2),t(S);var ne=e(S,2);r(ne,{title:"log_artifact",local:"trackio.log_artifact",headingTag:"h2"});var R=e(ne,2),Le=o(R);a(Le,{name:"trackio.log_artifact",anchor:"trackio.log_artifact",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L716",parameters:[{name:"artifact_or_path",val:": trackio.artifact.Artifact | str | pathlib.Path"},{name:"name",val:": str | None = None"},{name:"type",val:": str | None = None"},{name:"aliases",val:": list[str] | None = None"}],parametersDescription:[{anchor:"trackio.log_artifact.artifact_or_path",description:`<strong>artifact_or_path</strong> (<code>Artifact</code>, <code>str</code>, or <code>Path</code>) &#x2014;
The artifact to log (must have at least one file added via
<code>add_file</code> or <code>add_dir</code>), or a path to a file or directory to
log as a new artifact.`,name:"artifact_or_path"},{anchor:"trackio.log_artifact.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Artifact name when logging a path. Defaults to
<code>run-&lt;run_id&gt;-&lt;basename&gt;</code>. Must not be passed with an <code>Artifact</code>.`,name:"name"},{anchor:"trackio.log_artifact.type",description:`<strong>type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Artifact type when logging a path (e.g. <code>&quot;model&quot;</code>, <code>&quot;dataset&quot;</code>).
Defaults to <code>&quot;unspecified&quot;</code>. Must not be passed with an
<code>Artifact</code>.`,name:"type"},{anchor:"trackio.log_artifact.aliases",description:`<strong>aliases</strong> (<code>list[str]</code>, <em>optional</em>) &#x2014;
Aliases to rotate onto the resulting version, alongside <code>latest</code>
(assigned automatically whenever a new version is created). Your
aliases rotate onto the version even when identical content is
de-duplicated.`,name:"aliases"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The logged <code>Artifact</code> instance, hydrated with <code>version</code>, <code>aliases</code>,
<code>size</code>, <code>manifest</code>, and <code>project</code> set.</p>
`}),n(2),t(R);var ie=e(R,2);r(ie,{title:"use_artifact",local:"trackio.use_artifact",headingTag:"h2"});var C=e(ie,2),He=o(C);a(He,{name:"trackio.use_artifact",anchor:"trackio.use_artifact",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L753",parameters:[{name:"artifact_or_name",val:": trackio.artifact.Artifact | str"},{name:"type",val:": str | None = None"}],parametersDescription:[{anchor:"trackio.use_artifact.artifact_or_name",description:`<strong>artifact_or_name</strong> (<code>Artifact</code> or <code>str</code>) &#x2014;
An already-logged <code>Artifact</code>, or an artifact name. A bare name
(<code>&quot;my-model&quot;</code>) resolves to <code>:latest</code>; you can also pin a version
(<code>&quot;my-model:v3&quot;</code>) or resolve an alias (<code>&quot;my-model:prod&quot;</code>).`,name:"artifact_or_name"},{anchor:"trackio.use_artifact.type",description:`<strong>type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If given, checked against the stored artifact type, raising if it
does not match.`,name:"type"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The fetched <code>Artifact</code>, hydrated and ready to <code>download()</code>.</p>
`}),n(2),t(C);var se=e(C,2);r(se,{title:"finish",local:"trackio.finish",headingTag:"h2"});var A=e(se,2),Qe=o(A);a(Qe,{name:"trackio.finish",anchor:"trackio.finish",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L848",parameters:[]}),n(2),t(A);var ce=e(A,2);r(ce,{title:"show",local:"trackio.show",headingTag:"h2"});var B=e(ce,2),ze=o(B);a(ze,{name:"trackio.show",anchor:"trackio.show",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L1100",parameters:[{name:"project",val:": str | None = None"},{name:"theme",val:": typing.Any = None"},{name:"mcp_server",val:": bool | None = None"},{name:"footer",val:": bool = True"},{name:"color_palette",val:": list[str] | None = None"},{name:"open_browser",val:": bool = True"},{name:"block_thread",val:": bool | None = None"},{name:"host",val:": str | None = None"},{name:"share",val:": bool | None = None"},{name:"server_port",val:": int | None = None"},{name:"frontend_dir",val:": str | pathlib.Path | None = None"}],parametersDescription:[{anchor:"trackio.show.project",description:`<strong>project</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the project whose runs to show. If not provided, all projects
will be shown and the user can select one.`,name:"project"},{anchor:"trackio.show.theme",description:`<strong>theme</strong> (<code>Any</code>, <em>optional</em>) &#x2014;
Ignored. Kept for backward compatibility; Trackio no longer uses Gradio themes.`,name:"theme"},{anchor:"trackio.show.mcp_server",description:`<strong>mcp_server</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, the dashboard exposes an MCP server at <code>/mcp</code> when the optional
<code>trackio[mcp]</code> dependency is installed. If <code>None</code> (default), the
<code>GRADIO_MCP_SERVER</code> environment variable is used (e.g. on Spaces).`,name:"mcp_server"},{anchor:"trackio.show.footer",description:`<strong>footer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to include <code>footer=false</code> in the write-token URL when <code>False</code>.
This can also be controlled via the <code>footer</code> query parameter in the URL.`,name:"footer"},{anchor:"trackio.show.color_palette",description:`<strong>color_palette</strong> (<code>list[str]</code>, <em>optional</em>) &#x2014;
A list of hex color codes to use for plot lines. If not provided, the
<code>TRACKIO_COLOR_PALETTE</code> environment variable will be used (comma-separated
hex codes), or if that is not set, the default color palette will be used.
Example: <code>[&apos;#FF0000&apos;, &apos;#00FF00&apos;, &apos;#0000FF&apos;]</code>`,name:"color_palette"},{anchor:"trackio.show.open_browser",description:`<strong>open_browser</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If <code>True</code> and not in a notebook, a new browser tab will be opened with the
dashboard. If <code>False</code>, the browser will not be opened.`,name:"open_browser"},{anchor:"trackio.show.block_thread",description:`<strong>block_thread</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, the main thread will be blocked until the dashboard is closed.
If <code>None</code> (default behavior), then the main thread will not be blocked if the
dashboard is launched in a notebook, otherwise the main thread will be blocked.`,name:"block_thread"},{anchor:"trackio.show.host",description:`<strong>host</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The host to bind the server to. If not provided, defaults to <code>&apos;127.0.0.1&apos;</code>
(localhost only). Set to <code>&apos;0.0.0.0&apos;</code> to allow remote access.`,name:"host"},{anchor:"trackio.show.share",description:`<strong>share</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, creates a temporary public URL (Gradio-compatible tunnel). On Colab
or hosted notebooks, defaults to <code>True</code> unless overridden.`,name:"share"},{anchor:"trackio.show.server_port",description:`<strong>server_port</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Port to bind. If not set, scans from <code>GRADIO_SERVER_PORT</code> (default 7860).`,name:"server_port"},{anchor:"trackio.show.frontend_dir",description:`<strong>frontend_dir</strong> (<code>str | Path</code>, <em>optional</em>) &#x2014;
Directory containing a custom static frontend. Must contain <code>index.html</code>.
If not provided, Trackio checks <code>TRACKIO_FRONTEND_DIR</code>, then the persistent
Trackio config, then the bundled frontend. If an explicit <code>frontend_dir</code>
points to a missing or empty directory, Trackio copies in the starter
template and serves that directory.`,name:"frontend_dir"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The dashboard handle (<code>.close()</code> stops the server).
<code>url</code>: The local URL of the dashboard.
<code>share_url</code>: The public share URL, if any.
<code>full_url</code>: The full URL including the write token (share URL when sharing, else local).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>app</code></p>
`}),n(2),t(B);var de=e(B,2);r(de,{title:"sync",local:"trackio.sync",headingTag:"h2"});var W=e(de,2),Ye=o(W);a(Ye,{name:"trackio.sync",anchor:"trackio.sync",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/deploy.py#L1075",parameters:[{name:"project",val:": str"},{name:"space_id",val:": str | None = None"},{name:"private",val:": bool | None = None"},{name:"force",val:": bool = False"},{name:"run_in_background",val:": bool = False"},{name:"sdk",val:": str = 'gradio'"},{name:"dataset_id",val:": str | None = None"},{name:"bucket_id",val:": str | None = None"},{name:"frontend_dir",val:": str | pathlib.Path | None = None"}],parametersDescription:[{anchor:"trackio.sync.project",description:"<strong>project</strong> (<em>str</em>) &#x2014; The name of the project to upload.",name:"project"},{anchor:"trackio.sync.space_id",description:`<strong>space_id</strong> (<em>str</em>, <em>optional</em>) &#x2014; The ID of the Space to upload to (e.g., <em>&#x201C;username/space_id&#x201D;</em>).
If not provided, checks project metadata first, then generates a random space_id.`,name:"space_id"},{anchor:"trackio.sync.private",description:`<strong>private</strong> (<em>bool</em>, <em>optional</em>) &#x2014;
Whether to make the Space private. If None (default), the repo will be
public unless the organization&#x2019;s default is private. This value is ignored
if the repo already exists. Not supported with <code>sdk=&quot;static&quot;</code> because
static Trackio dashboards read snapshot data directly from the browser.`,name:"private"},{anchor:"trackio.sync.force",description:`<strong>force</strong> (<em>bool</em>, <em>optional</em>, defaults to <em>False</em>) &#x2014;
If <em>True</em>, overwrite the existing database without prompting for confirmation.
If <em>False</em>, prompt the user before overwriting an existing database.`,name:"force"},{anchor:"trackio.sync.run_in_background",description:`<strong>run_in_background</strong> (<em>bool</em>, <em>optional</em>, defaults to <em>False</em>) &#x2014;
If <em>True</em>, the Space creation and database upload will be run in a background thread.
If <em>False</em>, all the steps will be run synchronously.`,name:"run_in_background"},{anchor:"trackio.sync.sdk",description:`<strong>sdk</strong> (<em>str</em>, <em>optional</em>, defaults to <em>&#x201C;gradio&#x201D;</em>) &#x2014;
The type of Space to deploy. <em>&#x201C;gradio&#x201D;</em> deploys a Gradio Space with a live
server. <em>&#x201C;static&#x201D;</em> freezes the Space: deploys a static Space that reads from an HF Bucket
(no server needed).`,name:"sdk"},{anchor:"trackio.sync.dataset_id",description:`<strong>dataset_id</strong> (<em>str</em>, <em>optional</em>) &#x2014;
Deprecated: persisting trackio data to a Hugging Face Dataset will be
removed in a future version of trackio. Use <em>bucket_id</em> (a Hugging
Face Bucket) instead.`,name:"dataset_id"},{anchor:"trackio.sync.bucket_id",description:`<strong>bucket_id</strong> (<em>str</em>, <em>optional</em>) &#x2014;
The ID of the HF Bucket to sync to. By default, a bucket is auto-generated
from the space_id.`,name:"bucket_id"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The Space ID of the synced project.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><em>str</em></p>
`}),n(4),t(W);var le=e(W,2);r(le,{title:"freeze",local:"trackio.freeze",headingTag:"h2"});var q=e(le,2),Pe=o(q);a(Pe,{name:"trackio.freeze",anchor:"trackio.freeze",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/deploy.py#L1230",parameters:[{name:"space_id",val:": str"},{name:"project",val:": str"},{name:"new_space_id",val:": str | None = None"},{name:"private",val:": bool | None = None"},{name:"bucket_id",val:": str | None = None"},{name:"frontend_dir",val:": str | pathlib.Path | None = None"}],parametersDescription:[{anchor:"trackio.freeze.space_id",description:`<strong>space_id</strong> (<code>str</code>) &#x2014;
The ID of the source Gradio Space (e.g., <code>&quot;username/my-space&quot;</code> or a
short repo name with the logged-in namespace inferred, like <code>init()</code>).
Must be a Gradio Space with a bucket mounted at <code>/data</code>.`,name:"space_id"},{anchor:"trackio.freeze.project",description:`<strong>project</strong> (<code>str</code>) &#x2014;
The name of the project whose data to include in the frozen Space.`,name:"project"},{anchor:"trackio.freeze.new_space_id",description:`<strong>new_space_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The ID for the new static Space. If not provided, defaults to
<code>&quot;{space_id}_static&quot;</code>.`,name:"new_space_id"},{anchor:"trackio.freeze.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Not supported. Frozen static dashboards read snapshot data directly
from the browser, so the destination snapshot must be public.`,name:"private"},{anchor:"trackio.freeze.bucket_id",description:`<strong>bucket_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The ID of the HF Bucket for the new static Space&#x2019;s data storage.
If not provided, one is auto-generated from the new Space ID.`,name:"bucket_id"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The Space ID of the newly created static Space.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>str</code></p>
`}),n(2),t(q);var pe=e(q,2);r(pe,{title:"delete_project",local:"trackio.delete_project",headingTag:"h2"});var F=e(pe,2),Xe=o(F);a(Xe,{name:"trackio.delete_project",anchor:"trackio.delete_project",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L894",parameters:[{name:"project",val:": str"},{name:"force",val:": bool = False"}],parametersDescription:[{anchor:"trackio.delete_project.project",description:`<strong>project</strong> (<code>str</code>) &#x2014;
The name of the project to delete.`,name:"project"},{anchor:"trackio.delete_project.force",description:`<strong>force</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, deletes the project without prompting for confirmation.
If <code>False</code>, prompts the user to confirm before deleting.`,name:"force"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>True</code> if the project was deleted, <code>False</code> otherwise.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>bool</code></p>
`}),n(2),t(F);var me=e(F,2);r(me,{title:"import_csv",local:"trackio.import_csv",headingTag:"h2"});var D=e(me,2),Ve=o(D);a(Ve,{name:"trackio.import_csv",anchor:"trackio.import_csv",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/imports.py#L9",parameters:[{name:"csv_path",val:": str | pathlib.Path"},{name:"project",val:": str"},{name:"name",val:": str | None = None"},{name:"space_id",val:": str | None = None"},{name:"dataset_id",val:": str | None = None"},{name:"private",val:": bool | None = None"},{name:"force",val:": bool = False"}],parametersDescription:[{anchor:"trackio.import_csv.csv_path",description:`<strong>csv_path</strong> (<code>str</code> or <code>Path</code>) &#x2014;
The str or Path to the CSV file to import.`,name:"csv_path"},{anchor:"trackio.import_csv.project",description:`<strong>project</strong> (<code>str</code>) &#x2014;
The name of the project to import the CSV file into. Must not be an existing
project.`,name:"project"},{anchor:"trackio.import_csv.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the Run to import the CSV file into. If not provided, a default
name will be generated.`,name:"name"},{anchor:"trackio.import_csv.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the run (if not provided, a default name will be generated).`,name:"name"},{anchor:"trackio.import_csv.space_id",description:`<strong>space_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If provided, the project will be logged to a Hugging Face Space instead of a
local directory. Should be a complete Space name like <code>&quot;username/reponame&quot;</code>
or <code>&quot;orgname/reponame&quot;</code>, or just <code>&quot;reponame&quot;</code> in which case the Space will
be created in the currently-logged-in Hugging Face user&#x2019;s namespace. If the
Space does not exist, it will be created. If the Space already exists, the
project will be logged to it.`,name:"space_id"},{anchor:"trackio.import_csv.dataset_id",description:`<strong>dataset_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Deprecated: persisting trackio data to a Hugging Face Dataset will be
removed in a future version of trackio. Use <code>bucket_id</code> (a Hugging
Face Bucket) instead.`,name:"dataset_id"},{anchor:"trackio.import_csv.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the Space private. If None (default), the repo will be
public unless the organization&#x2019;s default is private. This value is ignored
if the repo already exists.`,name:"private"}]}),n(4),t(D);var he=e(D,2);r(he,{title:"import_tf_events",local:"trackio.import_tf_events",headingTag:"h2"});var E=e(he,2),Ke=o(E);a(Ke,{name:"trackio.import_tf_events",anchor:"trackio.import_tf_events",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/imports.py#L163",parameters:[{name:"log_dir",val:": str | pathlib.Path"},{name:"project",val:": str"},{name:"name",val:": str | None = None"},{name:"space_id",val:": str | None = None"},{name:"dataset_id",val:": str | None = None"},{name:"private",val:": bool | None = None"},{name:"force",val:": bool = False"}],parametersDescription:[{anchor:"trackio.import_tf_events.log_dir",description:`<strong>log_dir</strong> (<code>str</code> or <code>Path</code>) &#x2014;
The str or Path to the directory containing TensorFlow Events files.`,name:"log_dir"},{anchor:"trackio.import_tf_events.project",description:`<strong>project</strong> (<code>str</code>) &#x2014;
The name of the project to import the TensorFlow Events files into. Must not
be an existing project.`,name:"project"},{anchor:"trackio.import_tf_events.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name prefix for runs (if not provided, will use directory names). Each
subdirectory will create a separate run.`,name:"name"},{anchor:"trackio.import_tf_events.space_id",description:`<strong>space_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If provided, the project will be logged to a Hugging Face Space instead of a
local directory. Should be a complete Space name like <code>&quot;username/reponame&quot;</code>
or <code>&quot;orgname/reponame&quot;</code>, or just <code>&quot;reponame&quot;</code> in which case the Space will
be created in the currently-logged-in Hugging Face user&#x2019;s namespace. If the
Space does not exist, it will be created. If the Space already exists, the
project will be logged to it.`,name:"space_id"},{anchor:"trackio.import_tf_events.dataset_id",description:`<strong>dataset_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Deprecated: persisting trackio data to a Hugging Face Dataset will be
removed in a future version of trackio. Use <code>bucket_id</code> (a Hugging
Face Bucket) instead.`,name:"dataset_id"},{anchor:"trackio.import_tf_events.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the Space private. If None (default), the repo will be
public unless the organization&#x2019;s default is private. This value is ignored
if the repo already exists.`,name:"private"}]}),n(2),t(E);var ue=e(E,2);r(ue,{title:"save",local:"trackio.save",headingTag:"h2"});var G=e(ue,2),ge=o(G);a(ge,{name:"trackio.save",anchor:"trackio.save",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/__init__.py#L949",parameters:[{name:"glob_str",val:": str | pathlib.Path"},{name:"project",val:": str | None = None"}],parametersDescription:[{anchor:"trackio.save.glob_str",description:`<strong>glob_str</strong> (<code>str</code> or <code>Path</code>) &#x2014;
The file path or glob pattern to save. Can be a single file or a pattern
matching multiple files (e.g., <code>&quot;*.py&quot;</code>, <code>&quot;models/**/*.pth&quot;</code>).`,name:"glob_str"},{anchor:"trackio.save.project",description:`<strong>project</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the project to save files to. If not provided, uses the current
project from <code>trackio.init()</code>. If no project is initialized, raises an
error.`,name:"project"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The path where the file(s) were saved (project’s files directory).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>str</code></p>
`});var Oe=e(ge,4);v(Oe,{anchor:"trackio.save.example",children:(s,p)=>{var i=y(),c=e(h(i),2);b(c,{code:"aW1wb3J0JTIwdHJhY2tpbyUwQSUwQXRyYWNraW8uaW5pdChwcm9qZWN0JTNEJTIybXktcHJvamVjdCUyMiklMEF0cmFja2lvLnNhdmUoJTIyY29uZmlnLnlhbWwlMjIpJTBBdHJhY2tpby5zYXZlKCUyMm1vZGVscyUyRioucHRoJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> trackio
trackio.init(project=<span class="hljs-string">&quot;my-project&quot;</span>)
trackio.save(<span class="hljs-string">&quot;config.yaml&quot;</span>)
trackio.save(<span class="hljs-string">&quot;models/*.pth&quot;</span>)`,lang:"python",wrap:!1}),d(s,i)},$$slots:{default:!0}}),t(G);var be=e(G,2);r(be,{title:"Artifact",local:"trackio.Artifact",headingTag:"h2"});var Z=e(be,2),ve=o(Z);a(ve,{name:"class trackio.Artifact",anchor:"trackio.Artifact",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/artifact.py#L109",parameters:[{name:"name",val:": str"},{name:"type",val:": str"},{name:"description",val:": str | None = None"},{name:"metadata",val:": dict | None = None"}],parametersDescription:[{anchor:"trackio.Artifact.name",description:`<strong>name</strong> (<code>str</code>) &#x2014;
Artifact name, unique within the project. Must match
<code>^[A-Za-z0-9._-]+$</code> (letters, digits, dot, underscore, hyphen).`,name:"name"},{anchor:"trackio.Artifact.type",description:`<strong>type</strong> (<code>str</code>) &#x2014;
Free-form category such as <code>&quot;model&quot;</code> or <code>&quot;dataset&quot;</code>, used to group
artifacts.`,name:"type"},{anchor:"trackio.Artifact.description",description:`<strong>description</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Human-readable description of the artifact.`,name:"description"},{anchor:"trackio.Artifact.metadata",description:`<strong>metadata</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Arbitrary JSON-serializable metadata stored alongside the version.`,name:"metadata"}]});var L=e(ve,6),$e=o(L);a($e,{name:"add_dir",anchor:"trackio.Artifact.add_dir",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/artifact.py#L268",parameters:[{name:"local_dir",val:": str | pathlib.Path"},{name:"name",val:": str | None = None"}],parametersDescription:[{anchor:"trackio.Artifact.add_dir.local_dir",description:`<strong>local_dir</strong> (<code>str</code> or <code>Path</code>) &#x2014;
Path to an existing directory whose files are added.`,name:"local_dir"},{anchor:"trackio.Artifact.add_dir.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Logical path prefix for the added files. Defaults to no prefix,
so files keep their paths relative to <code>local_dir</code>.`,name:"name"}]}),n(4),t(L);var H=e(L,2),eo=o(H);a(eo,{name:"add_file",anchor:"trackio.Artifact.add_file",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/artifact.py#L248",parameters:[{name:"local_path",val:": str | pathlib.Path"},{name:"name",val:": str | None = None"}],parametersDescription:[{anchor:"trackio.Artifact.add_file.local_path",description:`<strong>local_path</strong> (<code>str</code> or <code>Path</code>) &#x2014;
Path to an existing regular file to add.`,name:"local_path"},{anchor:"trackio.Artifact.add_file.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Logical path the file is stored under inside the artifact.
Defaults to the file&#x2019;s basename.`,name:"name"}]}),n(2),t(H);var Q=e(H,2),oo=o(Q);a(oo,{name:"add_reference",anchor:"trackio.Artifact.add_reference",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/artifact.py#L298",parameters:[{name:"uri",val:": str"},{name:"name",val:": str | None = None"},{name:"checksum",val:": bool = True"},{name:"max_objects",val:": int | None = None"}],parametersDescription:[{anchor:"trackio.Artifact.add_reference.uri",description:`<strong>uri</strong> (<code>str</code>) &#x2014;
Location of the referenced data, percent-encoded (build local
URIs with <code>pathlib.Path.as_uri()</code>). <code>file://</code>, <code>http(s)://</code>,
and <code>hf://</code> are resolved and fetched natively; any other scheme
(<code>s3://</code>, <code>gs://</code>, Azure blob URLs, &#x2026;) requires a custom
<code>ReferenceHandler</code> registered via
<code>trackio.register_reference_handler</code> &#x2014; see the artifacts
documentation for complete examples &#x2014; and raises otherwise.`,name:"uri"},{anchor:"trackio.Artifact.add_reference.name",description:`<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Logical path the reference is stored under. Defaults to the last
segment of <code>uri</code>; for an expanded prefix (ending with /) it is the
prefix under which each object&#x2019;s relative path is nested.`,name:"name"},{anchor:"trackio.Artifact.add_reference.checksum",description:`<strong>checksum</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
When <code>True</code>, probes the source to derive its size and a
checksum (and to expand a directory/prefix): <code>file://</code> is
stream-hashed to a sha256, <code>hf://</code> uses its LFS sha256 or git
blob id, and <code>http(s)://</code> uses the server <code>ETag</code>. This may read
the filesystem or make network requests. When no checksum can
be obtained for a <em>remote</em> source (e.g. no ETag), the URI
itself is used as the <code>digest</code> and a warning is emitted. A
local <code>file://</code> path that does not exist instead raises. Pass
<code>checksum=False</code> to skip remote probing entirely.`,name:"checksum"},{anchor:"trackio.Artifact.add_reference.max_objects",description:`<strong>max_objects</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Cap on how many objects a directory/prefix expands into (default
10,000); exceeding it raises.`,name:"max_objects"}]}),n(8),t(Q);var z=e(Q,2),to=o(z);a(to,{name:"download",anchor:"trackio.Artifact.download",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/artifact.py#L449",parameters:[{name:"root",val:": str | pathlib.Path | None = None"}],parametersDescription:[{anchor:"trackio.Artifact.download.root",description:`<strong>root</strong> (<code>str</code> or <code>Path</code>, <em>optional</em>) &#x2014;
Directory to write the files into. Defaults to
<code>./.trackio/artifact-downloads/&lt;project&gt;/&lt;name&gt;_v&lt;version&gt;/</code>,
keyed by project so same-named artifacts from different projects
never collide, and by the resolved version so a moving alias
like <code>latest</code> never leaves behind stale files from a previous
version.`,name:"root"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The absolute path to the download directory, as a string.</p>
`}),n(6),t(z);var Y=e(z,2),ao=o(Y);a(ao,{name:"get_entry_uri",anchor:"trackio.Artifact.get_entry_uri",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/artifact.py#L536",parameters:[{name:"name",val:": str"}]}),n(2),t(Y);var ye=e(Y,2),ro=o(ye);a(ro,{name:"wait",anchor:"trackio.Artifact.wait",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/artifact.py#L238",parameters:[{name:"timeout",val:": int | None = None"}]}),n(2),t(ye),t(Z);var fe=e(Z,2);r(fe,{title:"Image",local:"trackio.TrackioImage",headingTag:"h2"});var P=e(fe,2),_e=o(P);a(_e,{name:"class trackio.TrackioImage",anchor:"trackio.TrackioImage",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/media/image.py#L13",parameters:[{name:"value",val:": str | pathlib.Path | numpy.ndarray | PIL.Image.Image"},{name:"caption",val:": str | None = None"}],parametersDescription:[{anchor:"trackio.TrackioImage.value",description:`<strong>value</strong> (<code>str</code>, <code>Path</code>, <code>numpy.ndarray</code>, or <code>PIL.Image</code>, <em>optional</em>) &#x2014;
A path to an image, a PIL Image, or a numpy array of shape (height, width, channels).
If numpy array, should be of type <code>np.uint8</code> with RGB values in the range <code>[0, 255]</code>.`,name:"value"},{anchor:"trackio.TrackioImage.caption",description:`<strong>caption</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string caption for the image.`,name:"caption"}]});var no=e(_e,4);v(no,{anchor:"trackio.TrackioImage.example",children:(s,p)=>{var i=y(),c=e(h(i),2);b(c,{code:"aW1wb3J0JTIwdHJhY2tpbyUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQSUyMyUyMENyZWF0ZSUyMGFuJTIwaW1hZ2UlMjBmcm9tJTIwbnVtcHklMjBhcnJheSUwQWltYWdlX2RhdGElMjAlM0QlMjBucC5yYW5kb20ucmFuZGludCgwJTJDJTIwMjU1JTJDJTIwKDY0JTJDJTIwNjQlMkMlMjAzKSUyQyUyMGR0eXBlJTNEbnAudWludDgpJTBBaW1hZ2UlMjAlM0QlMjB0cmFja2lvLkltYWdlKGltYWdlX2RhdGElMkMlMjBjYXB0aW9uJTNEJTIyUmFuZG9tJTIwaW1hZ2UlMjIpJTBBdHJhY2tpby5sb2coJTdCJTIybXlfaW1hZ2UlMjIlM0ElMjBpbWFnZSU3RCklMEElMEElMjMlMjBDcmVhdGUlMjBhbiUyMGltYWdlJTIwZnJvbSUyMFBJTCUyMEltYWdlJTBBcGlsX2ltYWdlJTIwJTNEJTIwSW1hZ2UubmV3KCdSR0InJTJDJTIwKDEwMCUyQyUyMDEwMCklMkMlMjBjb2xvciUzRCdyZWQnKSUwQWltYWdlJTIwJTNEJTIwdHJhY2tpby5JbWFnZShwaWxfaW1hZ2UlMkMlMjBjYXB0aW9uJTNEJTIyUmVkJTIwc3F1YXJlJTIyKSUwQXRyYWNraW8ubG9nKCU3QiUyMnJlZF9pbWFnZSUyMiUzQSUyMGltYWdlJTdEKSUwQSUwQSUyMyUyMENyZWF0ZSUyMGFuJTIwaW1hZ2UlMjBmcm9tJTIwZmlsZSUyMHBhdGglMEFpbWFnZSUyMCUzRCUyMHRyYWNraW8uSW1hZ2UoJTIycGF0aCUyRnRvJTJGaW1hZ2UuanBnJTIyJTJDJTIwY2FwdGlvbiUzRCUyMlBob3RvJTIwZnJvbSUyMGZpbGUlMjIpJTBBdHJhY2tpby5sb2coJTdCJTIyZmlsZV9pbWFnZSUyMiUzQSUyMGltYWdlJTdEKQ==",highlighted:`<span class="hljs-keyword">import</span> trackio
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-comment"># Create an image from numpy array</span>
image_data = np.random.randint(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, (<span class="hljs-number">64</span>, <span class="hljs-number">64</span>, <span class="hljs-number">3</span>), dtype=np.uint8)
image = trackio.Image(image_data, caption=<span class="hljs-string">&quot;Random image&quot;</span>)
trackio.log({<span class="hljs-string">&quot;my_image&quot;</span>: image})
<span class="hljs-comment"># Create an image from PIL Image</span>
pil_image = Image.new(<span class="hljs-string">&#x27;RGB&#x27;</span>, (<span class="hljs-number">100</span>, <span class="hljs-number">100</span>), color=<span class="hljs-string">&#x27;red&#x27;</span>)
image = trackio.Image(pil_image, caption=<span class="hljs-string">&quot;Red square&quot;</span>)
trackio.log({<span class="hljs-string">&quot;red_image&quot;</span>: image})
<span class="hljs-comment"># Create an image from file path</span>
image = trackio.Image(<span class="hljs-string">&quot;path/to/image.jpg&quot;</span>, caption=<span class="hljs-string">&quot;Photo from file&quot;</span>)
trackio.log({<span class="hljs-string">&quot;file_image&quot;</span>: image})`,lang:"python",wrap:!1}),d(s,i)},$$slots:{default:!0}}),t(P);var ke=e(P,2);r(ke,{title:"Video",local:"trackio.TrackioVideo",headingTag:"h2"});var X=e(ke,2),we=o(X);a(we,{name:"class trackio.TrackioVideo",anchor:"trackio.TrackioVideo",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/media/video.py#L17",parameters:[{name:"value",val:": str | pathlib.Path | numpy.ndarray"},{name:"caption",val:": str | None = None"},{name:"fps",val:": int | None = None"},{name:"format",val:": typing.Optional[typing.Literal['gif', 'mp4', 'webm']] = None"}],parametersDescription:[{anchor:"trackio.TrackioVideo.value",description:`<strong>value</strong> (<code>str</code>, <code>Path</code>, or <code>numpy.ndarray</code>, <em>optional</em>) &#x2014;
A path to a video file, or a numpy array.
If numpy array, should be of type <code>np.uint8</code> with RGB values in the range <code>[0, 255]</code>.
It is expected to have shape of either (frames, channels, height, width) or (batch, frames, channels, height, width).
For the latter, the videos will be tiled into a grid.`,name:"value"},{anchor:"trackio.TrackioVideo.caption",description:`<strong>caption</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string caption for the video.`,name:"caption"},{anchor:"trackio.TrackioVideo.fps",description:`<strong>fps</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Frames per second for the video. Only used when value is an ndarray. Default is <code>24</code>.`,name:"fps"},{anchor:"trackio.TrackioVideo.format",description:`<strong>format</strong> (<code>Literal[&quot;gif&quot;, &quot;mp4&quot;, &quot;webm&quot;]</code>, <em>optional</em>) &#x2014;
Video format (&#x201C;gif&#x201D;, &#x201C;mp4&#x201D;, or &#x201C;webm&#x201D;). Only used when value is an ndarray. Default is &#x201C;gif&#x201D;.`,name:"format"}]});var Te=e(we,4);v(Te,{anchor:"trackio.TrackioVideo.example",children:(s,p)=>{var i=y(),c=e(h(i),2);b(c,{code:"aW1wb3J0JTIwdHJhY2tpbyUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQSUyMyUyMENyZWF0ZSUyMGElMjBzaW1wbGUlMjB2aWRlbyUyMGZyb20lMjBudW1weSUyMGFycmF5JTBBZnJhbWVzJTIwJTNEJTIwbnAucmFuZG9tLnJhbmRpbnQoMCUyQyUyMDI1NSUyQyUyMCgxMCUyQyUyMDMlMkMlMjA2NCUyQyUyMDY0KSUyQyUyMGR0eXBlJTNEbnAudWludDgpJTBBdmlkZW8lMjAlM0QlMjB0cmFja2lvLlZpZGVvKGZyYW1lcyUyQyUyMGNhcHRpb24lM0QlMjJSYW5kb20lMjB2aWRlbyUyMiUyQyUyMGZwcyUzRDMwKSUwQSUwQSUyMyUyMENyZWF0ZSUyMGElMjBiYXRjaCUyMG9mJTIwdmlkZW9zJTBBYmF0Y2hfZnJhbWVzJTIwJTNEJTIwbnAucmFuZG9tLnJhbmRpbnQoMCUyQyUyMDI1NSUyQyUyMCgzJTJDJTIwMTAlMkMlMjAzJTJDJTIwNjQlMkMlMjA2NCklMkMlMjBkdHlwZSUzRG5wLnVpbnQ4KSUwQWJhdGNoX3ZpZGVvJTIwJTNEJTIwdHJhY2tpby5WaWRlbyhiYXRjaF9mcmFtZXMlMkMlMjBjYXB0aW9uJTNEJTIyQmF0Y2glMjBvZiUyMHZpZGVvcyUyMiUyQyUyMGZwcyUzRDE1KSUwQSUwQSUyMyUyMENyZWF0ZSUyMHZpZGVvJTIwZnJvbSUyMGZpbGUlMjBwYXRoJTBBdmlkZW8lMjAlM0QlMjB0cmFja2lvLlZpZGVvKCUyMnBhdGglMkZ0byUyRnZpZGVvLm1wNCUyMiUyQyUyMGNhcHRpb24lM0QlMjJWaWRlbyUyMGZyb20lMjBmaWxlJTIyKQ==",highlighted:`<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>)
<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>)
<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>)`,lang:"python",wrap:!1}),d(s,i)},$$slots:{default:!0}});var Me=e(Te,2),io=o(Me);a(io,{name:"write_video",anchor:"trackio.TrackioVideo.write_video",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/media/video.py#L93",parameters:[{name:"file_path",val:": str | pathlib.Path"},{name:"video",val:": ndarray"},{name:"fps",val:": float"},{name:"codec",val:": typing.Literal['h264', 'vp9', 'gif']"}]}),n(2),t(Me),t(X);var je=e(X,2);r(je,{title:"Audio",local:"trackio.TrackioAudio",headingTag:"h2"});var V=e(je,2),xe=o(V);a(xe,{name:"class trackio.TrackioAudio",anchor:"trackio.TrackioAudio",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/media/audio.py#L19",parameters:[{name:"value",val:": str | pathlib.Path | numpy.ndarray"},{name:"caption",val:": str | None = None"},{name:"sample_rate",val:": int | None = None"},{name:"format",val:": typing.Optional[typing.Literal['wav', 'mp3']] = None"}],parametersDescription:[{anchor:"trackio.TrackioAudio.value",description:`<strong>value</strong> (<code>str</code>, <code>Path</code>, or <code>numpy.ndarray</code>, <em>optional</em>) &#x2014;
A path to an audio file, or a numpy array.
The array should be shaped <code>(samples,)</code> for mono or <code>(samples, 2)</code> for stereo.
Float arrays will be peak-normalized and converted to 16-bit PCM; integer arrays will be converted to 16-bit PCM as needed.`,name:"value"},{anchor:"trackio.TrackioAudio.caption",description:`<strong>caption</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string caption for the audio.`,name:"caption"},{anchor:"trackio.TrackioAudio.sample_rate",description:`<strong>sample_rate</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Sample rate in Hz. Required when <code>value</code> is a numpy array.`,name:"sample_rate"},{anchor:"trackio.TrackioAudio.format",description:`<strong>format</strong> (<code>Literal[&quot;wav&quot;, &quot;mp3&quot;]</code>, <em>optional</em>) &#x2014;
Audio format used when <code>value</code> is a numpy array. Default is &#x201C;wav&#x201D;.`,name:"format"}]});var Ue=e(xe,4);v(Ue,{anchor:"trackio.TrackioAudio.example",children:(s,p)=>{var i=y(),c=e(h(i),2);b(c,{code:"aW1wb3J0JTIwdHJhY2tpbyUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwYSUyMDEtc2Vjb25kJTIwNDQwJTIwSHolMjBzaW5lJTIwd2F2ZSUyMChtb25vKSUwQXNyJTIwJTNEJTIwMTYwMDAlMEF0JTIwJTNEJTIwbnAubGluc3BhY2UoMCUyQyUyMDElMkMlMjBzciUyQyUyMGVuZHBvaW50JTNERmFsc2UpJTBBd2F2ZSUyMCUzRCUyMDAuMiUyMColMjBucC5zaW4oMiUyMColMjBucC5waSUyMColMjA0NDAlMjAqJTIwdCklMEFhdWRpbyUyMCUzRCUyMHRyYWNraW8uQXVkaW8od2F2ZSUyQyUyMGNhcHRpb24lM0QlMjJBNCUyMHNpbmUlMjIlMkMlMjBzYW1wbGVfcmF0ZSUzRHNyJTJDJTIwZm9ybWF0JTNEJTIyd2F2JTIyKSUwQXRyYWNraW8ubG9nKCU3QiUyMnRvbmUlMjIlM0ElMjBhdWRpbyU3RCklMEElMEElMjMlMjBTdGVyZW8lMjBmcm9tJTIwbnVtcHklMjBhcnJheSUyMChzaGFwZSUzQSUyMHNhbXBsZXMlMkMlMjAyKSUwQXN0ZXJlbyUyMCUzRCUyMG5wLnN0YWNrKCU1QndhdmUlMkMlMjB3YXZlJTVEJTJDJTIwYXhpcyUzRDEpJTBBYXVkaW8lMjAlM0QlMjB0cmFja2lvLkF1ZGlvKHN0ZXJlbyUyQyUyMGNhcHRpb24lM0QlMjJTdGVyZW8lMjIlMkMlMjBzYW1wbGVfcmF0ZSUzRHNyJTJDJTIwZm9ybWF0JTNEJTIybXAzJTIyKSUwQXRyYWNraW8ubG9nKCU3QiUyMnN0ZXJlbyUyMiUzQSUyMGF1ZGlvJTdEKSUwQSUwQSUyMyUyMEZyb20lMjBhbiUyMGV4aXN0aW5nJTIwZmlsZSUwQWF1ZGlvJTIwJTNEJTIwdHJhY2tpby5BdWRpbyglMjJwYXRoJTJGdG8lMkZhdWRpby53YXYlMjIlMkMlMjBjYXB0aW9uJTNEJTIyRnJvbSUyMGZpbGUlMjIpJTBBdHJhY2tpby5sb2coJTdCJTIyZmlsZV9hdWRpbyUyMiUzQSUyMGF1ZGlvJTdEKQ==",highlighted:`<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})`,lang:"python",wrap:!1}),d(s,i)},$$slots:{default:!0}});var Ne=e(Ue,2),so=o(Ne);a(so,{name:"ensure_int16_pcm",anchor:"trackio.TrackioAudio.ensure_int16_pcm",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/media/audio.py#L90",parameters:[{name:"data",val:": ndarray"}]}),n(2),t(Ne),t(V);var Ie=e(V,2);r(Ie,{title:"Html",local:"trackio.TrackioHtml",headingTag:"h2"});var K=e(Ie,2),Je=o(K);a(Je,{name:"class trackio.TrackioHtml",anchor:"trackio.TrackioHtml",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/media/html.py#L17",parameters:[{name:"data",val:": typing.Any"},{name:"inject",val:": bool = True"},{name:"data_is_not_path",val:": bool = False"},{name:"caption",val:": str | None = None"}],parametersDescription:[{anchor:"trackio.TrackioHtml.data",description:`<strong>data</strong> (<code>str</code>, <code>Path</code>, file-like, Plotly figure, or Matplotlib figure) &#x2014;
Raw HTML, a path to an <code>.html</code> file, a file-like object, or a Plotly
or Matplotlib figure.`,name:"data"},{anchor:"trackio.TrackioHtml.inject",description:`<strong>inject</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Wrap HTML fragments in a styled document. Default is <code>True</code>.`,name:"inject"},{anchor:"trackio.TrackioHtml.data_is_not_path",description:`<strong>data_is_not_path</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Accepted for <code>wandb.Html</code> compatibility but ignored.`,name:"data_is_not_path"},{anchor:"trackio.TrackioHtml.caption",description:`<strong>caption</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string caption for the HTML.`,name:"caption"}]});var co=e(Je,4);v(co,{anchor:"trackio.TrackioHtml.example",children:(s,p)=>{var i=y(),c=e(h(i),2);b(c,{code:"aW1wb3J0JTIwdHJhY2tpbyUwQSUwQXRyYWNraW8uaW5pdChwcm9qZWN0JTNEJTIybXktcHJvamVjdCUyMiklMEElMEElMjMlMjBSYXclMjBIVE1MJTBBdHJhY2tpby5sb2coJTdCJTIycmVwb3J0JTIyJTNBJTIwdHJhY2tpby5IdG1sKCUyMiUzQ2gxJTNFUmVzdWx0cyUzQyUyRmgxJTNFJTIyKSU3RCklMEElMEElMjMlMjBQbG90bHklMjBmaWd1cmUlMEFpbXBvcnQlMjBwbG90bHkuZXhwcmVzcyUyMGFzJTIwcHglMEElMEFmaWclMjAlM0QlMjBweC5saW5lKHglM0QlNUIxJTJDJTIwMiUyQyUyMDMlNUQlMkMlMjB5JTNEJTVCNCUyQyUyMDUlMkMlMjA2JTVEKSUwQXRyYWNraW8ubG9nKCU3QiUyMnBsb3QlMjIlM0ElMjB0cmFja2lvLkh0bWwoZmlnKSU3RCklMEElMEElMjMlMjBNYXRwbG90bGliJTIwZmlndXJlJTBBaW1wb3J0JTIwbWF0cGxvdGxpYi5weXBsb3QlMjBhcyUyMHBsdCUwQSUwQXBsdC5wbG90KCU1QjElMkMlMjAyJTJDJTIwMyUyQyUyMDQlNUQpJTBBdHJhY2tpby5sb2coJTdCJTIyY2hhcnQlMjIlM0ElMjB0cmFja2lvLkh0bWwocGx0KSU3RCk=",highlighted:`<span class="hljs-keyword">import</span> trackio
trackio.init(project=<span class="hljs-string">&quot;my-project&quot;</span>)
<span class="hljs-comment"># Raw HTML</span>
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>)})
<span class="hljs-comment"># Plotly figure</span>
<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>: trackio.Html(fig)})
<span class="hljs-comment"># Matplotlib figure</span>
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
plt.plot([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>])
trackio.log({<span class="hljs-string">&quot;chart&quot;</span>: trackio.Html(plt)})`,lang:"python",wrap:!1}),d(s,i)},$$slots:{default:!0}}),t(K);var Se=e(K,2);r(Se,{title:"Table",local:"trackio.Table",headingTag:"h2"});var O=e(Se,2),Re=o(O);a(Re,{name:"class trackio.Table",anchor:"trackio.Table",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/table.py#L9",parameters:[{name:"columns",val:": list[str] | None = None"},{name:"data",val:": list[list[typing.Any]] | None = None"},{name:"dataframe",val:": typing.Optional[typing.Any] = None"},{name:"rows",val:": list[list[typing.Any]] | None = None"},{name:"optional",val:": bool | list[bool] = True"},{name:"allow_mixed_types",val:": bool = False"},{name:"log_mode",val:": typing.Optional[typing.Literal['IMMUTABLE', 'MUTABLE', 'INCREMENTAL']] = 'IMMUTABLE'"}],parametersDescription:[{anchor:"trackio.Table.columns",description:`<strong>columns</strong> (<code>list[str]</code>, <em>optional</em>) &#x2014;
Names of the columns in the table. Optional if <code>data</code> is provided. Not
expected if <code>dataframe</code> is provided. Currently ignored.`,name:"columns"},{anchor:"trackio.Table.data",description:`<strong>data</strong> (<code>list[list[Any]]</code>, <em>optional</em>) &#x2014;
2D row-oriented array of values. Each value can be a number, a string
(treated as Markdown and truncated if too long), or a <code>Trackio.Image</code> or
list of <code>Trackio.Image</code> objects.`,name:"data"},{anchor:"trackio.Table.dataframe",description:`<strong>dataframe</strong> (<code>pandas.DataFrame</code>, <em>optional</em>) &#x2014;
DataFrame used to create the table. When set, <code>data</code> and <code>columns</code>
arguments are ignored.`,name:"dataframe"},{anchor:"trackio.Table.rows",description:`<strong>rows</strong> (<code>list[list[Any]]</code>, <em>optional</em>) &#x2014;
Currently ignored.`,name:"rows"},{anchor:"trackio.Table.optional",description:`<strong>optional</strong> (<code>bool</code> or <code>list[bool]</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Currently ignored.`,name:"optional"},{anchor:"trackio.Table.allow_mixed_types",description:`<strong>allow_mixed_types</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Currently ignored.`,name:"allow_mixed_types"},{anchor:"trackio.Table.log_mode",description:`<strong>log_mode</strong> &#x2014; (<code>Literal[&quot;IMMUTABLE&quot;, &quot;MUTABLE&quot;, &quot;INCREMENTAL&quot;]</code> or <code>None</code>, <em>optional</em>, defaults to <code>&quot;IMMUTABLE&quot;</code>):
Currently ignored.`,name:"log_mode"}]});var Ce=e(Re,6),lo=o(Ce);a(lo,{name:"to_display_format",anchor:"trackio.Table.to_display_format",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/table.py#L124",parameters:[{name:"table_data",val:": list"}],parametersDescription:[{anchor:"trackio.Table.to_display_format.table_data",description:`<strong>table_data</strong> (<code>list[dict]</code>) &#x2014;
List of dictionaries representing table rows (from stored <code>_value</code>).`,name:"table_data"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Table data with images converted to markdown syntax and long
text truncated.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>list[dict]</code></p>
`}),n(4),t(Ce),t(O);var Ae=e(O,2);r(Ae,{title:"Histogram",local:"trackio.Histogram",headingTag:"h2"});var $=e(Ae,2),Be=o($);a(Be,{name:"class trackio.Histogram",anchor:"trackio.Histogram",source:"https://github.com/gradio-app/trackio/blob/vr_663/trackio/histogram.py#L6",parameters:[{name:"sequence",val:": typing.Union[numpy.ndarray, typing.Sequence[float], typing.Sequence[int], NoneType] = None"},{name:"np_histogram",val:": tuple | None = None"},{name:"num_bins",val:": int = 64"}],parametersDescription:[{anchor:"trackio.Histogram.sequence",description:`<strong>sequence</strong> (<code>np.ndarray</code> or <code>Sequence[float]</code> or <code>Sequence[int]</code>, <em>optional</em>) &#x2014;
Sequence of values to create the histogram from.`,name:"sequence"},{anchor:"trackio.Histogram.np_histogram",description:`<strong>np_histogram</strong> (<code>tuple</code>, <em>optional</em>) &#x2014;
Pre-computed NumPy histogram as a <code>(hist, bins)</code> tuple.`,name:"np_histogram"},{anchor:"trackio.Histogram.num_bins",description:`<strong>num_bins</strong> (<code>int</code>, <em>optional</em>, defaults to <code>64</code>) &#x2014;
Number of bins for the histogram (maximum <code>512</code>).`,name:"num_bins"}]});var po=e(Be,4);v(po,{anchor:"trackio.Histogram.example",children:(s,p)=>{var i=y(),c=e(h(i),2);b(c,{code:"aW1wb3J0JTIwdHJhY2tpbyUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQSUyMyUyMENyZWF0ZSUyMGhpc3RvZ3JhbSUyMGZyb20lMjBzZXF1ZW5jZSUwQWRhdGElMjAlM0QlMjBucC5yYW5kb20ucmFuZG4oMTAwMCklMEF0cmFja2lvLmxvZyglN0IlMjJkaXN0cmlidXRpb24lMjIlM0ElMjB0cmFja2lvLkhpc3RvZ3JhbShkYXRhKSU3RCklMEElMEElMjMlMjBDcmVhdGUlMjBoaXN0b2dyYW0lMjBmcm9tJTIwbnVtcHklMjBoaXN0b2dyYW0lMEFoaXN0JTJDJTIwYmlucyUyMCUzRCUyMG5wLmhpc3RvZ3JhbShkYXRhJTJDJTIwYmlucyUzRDMwKSUwQXRyYWNraW8ubG9nKCU3QiUyMmRpc3RyaWJ1dGlvbiUyMiUzQSUyMHRyYWNraW8uSGlzdG9ncmFtKG5wX2hpc3RvZ3JhbSUzRChoaXN0JTJDJTIwYmlucykpJTdEKSUwQSUwQSUyMyUyMFNwZWNpZnklMjBjdXN0b20lMjBudW1iZXIlMjBvZiUyMGJpbnMlMEF0cmFja2lvLmxvZyglN0IlMjJkaXN0cmlidXRpb24lMjIlM0ElMjB0cmFja2lvLkhpc3RvZ3JhbShkYXRhJTJDJTIwbnVtX2JpbnMlM0Q1MCklN0Qp",highlighted:`<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 histogram from sequence</span>
data = np.random.randn(<span class="hljs-number">1000</span>)
trackio.log({<span class="hljs-string">&quot;distribution&quot;</span>: trackio.Histogram(data)})
<span class="hljs-comment"># Create histogram from numpy histogram</span>
hist, bins = np.histogram(data, bins=<span class="hljs-number">30</span>)
trackio.log({<span class="hljs-string">&quot;distribution&quot;</span>: trackio.Histogram(np_histogram=(hist, bins))})
<span class="hljs-comment"># Specify custom number of bins</span>
trackio.log({<span class="hljs-string">&quot;distribution&quot;</span>: trackio.Histogram(data, num_bins=<span class="hljs-number">50</span>)})`,lang:"python",wrap:!1}),d(s,i)},$$slots:{default:!0}}),t($);var mo=e($,2);vo(mo,{source:"https://github.com/gradio-app/trackio/blob/main/docs/source/api.md"}),n(2),d(U,_),Fe()}export{Bo as component};

Xet Storage Details

Size:
78.4 kB
·
Xet hash:
0e822af67763f12dfd631d6c7823f3778503d4bf5dabf6f0120a52ff36a10d66

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