You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,6 +245,8 @@ To get started and see basic examples of usage, see these files:
245
245
246
246
`trackio.log()` is a non-blocking call that appends to an in-memory queue and returns immediately. A background thread drains the queue every **0.5 s** and writes to the local SQLite database. Because log calls never touch the network or disk on the calling thread, the client-side throughput is effectively **unlimited** -- you can burst thousands of calls per second without slowing down your training loop.
247
247
248
+
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.
249
+
248
250
### Logging to a Hugging Face Space
249
251
250
252
When a `space_id` is provided, the same background thread batches queued entries and pushes them to the Space via the Gradio client API. The main factors that affect end-to-end throughput are:
Copy file name to clipboardExpand all lines: docs/source/track.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,8 @@ Once your run is initialized, you can start logging data using the [`log`] funct
52
52
trackio.log({"loss": 0.05})
53
53
```
54
54
55
+
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.
56
+
55
57
Each call to [`log`] automatically increments the step counter.
56
58
If you want to log multiple metrics at once, pass them together:
57
59
@@ -336,4 +338,4 @@ for batch_size in [16, 32, 64]:
336
338
trackio.finish()
337
339
```
338
340
339
-
In the dashboard, you can then group by "learning_rate" or "batch_size" to more easily compare runs with different hyperparameters.
341
+
In the dashboard, you can then group by "learning_rate" or "batch_size" to more easily compare runs with different hyperparameters.
f"trackio.init() could not inspect existing runs for project '{project}': {e}. Continuing without resume metadata."
107
+
)
108
+
return []
109
+
110
+
101
111
definit(
102
112
project: str,
103
113
name: str|None=None,
@@ -195,7 +205,7 @@ def init(
195
205
`Run`: A [`Run`] object that can be used to log metrics and finish the run.
196
206
"""
197
207
ifsettingsisnotNone:
198
-
warnings.warn(
208
+
_emit_nonfatal_warning(
199
209
"* Warning: settings is not used. Provided for compatibility with wandb.init(). Please create an issue at: https://github.com/gradio-app/trackio/issues if you need a specific feature implemented."
200
210
)
201
211
@@ -215,7 +225,7 @@ def init(
215
225
) frome
216
226
217
227
ifspace_idisNoneandbucket_idisnotNone:
218
-
warnings.warn(
228
+
_emit_nonfatal_warning(
219
229
"trackio.init() has `bucket_id` set but `space_id` is None: metrics will be logged "
220
230
"locally only. Pass `space_id` to create or use a Hugging Face Space, which will be "
221
231
"attached to the Hugging Face Bucket.",
@@ -259,32 +269,39 @@ def init(
259
269
ifnot_should_embed_local:
260
270
utils.print_dashboard_instructions(project)
261
271
else:
262
-
deploy.create_space_if_not_exists(
263
-
space_id,
264
-
space_storage,
265
-
dataset_id,
266
-
bucket_id,
267
-
private,
268
-
)
269
-
user_name, space_name=space_id.split("/")
270
-
space_url=deploy.SPACE_HOST_URL.format(
271
-
user_name=user_name, space_name=space_name
272
-
)
273
-
ifutils.is_in_notebook() andembed:
274
-
utils.embed_url_in_notebook(space_url)
272
+
try:
273
+
deploy.create_space_if_not_exists(
274
+
space_id,
275
+
space_storage,
276
+
dataset_id,
277
+
bucket_id,
278
+
private,
279
+
)
280
+
user_name, space_name=space_id.split("/")
281
+
space_url=deploy.SPACE_HOST_URL.format(
282
+
user_name=user_name, space_name=space_name
283
+
)
284
+
ifutils.is_in_notebook() andembed:
285
+
utils.embed_url_in_notebook(space_url)
286
+
exceptExceptionase:
287
+
_emit_nonfatal_warning(
288
+
f"trackio.init() could not prepare Space '{space_id}': {e}. Logging will continue in local fallback mode until the Space is reachable."
289
+
)
275
290
context_vars.current_project.set(project)
276
291
292
+
existing_runs=_safe_get_runs_for_init(project)
293
+
277
294
ifresume=="must":
278
295
ifnameisNone:
279
296
raiseValueError("Must provide a run name when resume='must'")
280
-
ifnamenotinSQLiteStorage.get_runs(project):
297
+
ifnamenotinexisting_runs:
281
298
raiseValueError(f"Run '{name}' does not exist in project '{project}'")
0 commit comments