2
2
title : Artifact
3
3
---
4
4
5
- {{< cta-button githubLink=https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L95-L2409 >}}
5
+ {{< cta-button githubLink=https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L96-L2410 >}}
6
6
7
7
Flexible and lightweight building block for dataset and model versioning.
8
8
@@ -27,6 +27,8 @@ begin with `add`. Once the artifact has all the desired files, you can call
27
27
| ` type ` | The artifact's type. Use the type of an artifact to both organize and differentiate artifacts. You can use any string that contains letters, numbers, underscores, hyphens, and dots. Common types include ` dataset ` or ` model ` . Include ` model ` within your type string if you want to link the artifact to the W&B Model Registry. |
28
28
| ` description ` | A description of the artifact. For Model or Dataset Artifacts, add documentation for your standardized team model or dataset card. View an artifact's description programmatically with the ` Artifact.description ` attribute or programmatically with the W&B App UI. W&B renders the description as markdown in the W&B App. |
29
29
| ` metadata ` | Additional information about an artifact. Specify metadata as a dictionary of key-value pairs. You can specify no more than 100 total keys. |
30
+ | ` incremental ` | Use ` Artifact.new_draft() ` method instead to modify an existing artifact. |
31
+ | ` use_as ` | W&B Launch specific parameter. Not recommended for general use. |
30
32
31
33
| Returns | |
32
34
| :--- | :--- |
@@ -67,7 +69,7 @@ begin with `add`. Once the artifact has all the desired files, you can call
67
69
68
70
### ` add `
69
71
70
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1481-L1572 )
72
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1487-L1578 )
71
73
72
74
``` python
73
75
add(
@@ -95,7 +97,7 @@ Add wandb.WBValue `obj` to the artifact.
95
97
96
98
### ` add_dir `
97
99
98
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1336-L1396 )
100
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1342-L1402 )
99
101
100
102
``` python
101
103
add_dir(
@@ -122,7 +124,7 @@ Add a local directory to the artifact.
122
124
123
125
### ` add_file `
124
126
125
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1283-L1334 )
127
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1289-L1340 )
126
128
127
129
``` python
128
130
add_file(
@@ -157,7 +159,7 @@ Add a local file to the artifact.
157
159
158
160
### ` add_reference `
159
161
160
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1398-L1479 )
162
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1404-L1485 )
161
163
162
164
``` python
163
165
add_reference(
@@ -209,7 +211,7 @@ blank.
209
211
210
212
### ` checkout `
211
213
212
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1992-L2020 )
214
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1993-L2021 )
213
215
214
216
``` python
215
217
checkout(
@@ -236,7 +238,7 @@ artifact.
236
238
237
239
### ` delete `
238
240
239
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2130-L2149 )
241
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2131-L2150 )
240
242
241
243
``` python
242
244
delete(
@@ -259,7 +261,7 @@ source artifact is unaffected.
259
261
260
262
### ` download `
261
263
262
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1750-L1801 )
264
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1756-L1807 )
263
265
264
266
``` python
265
267
download(
@@ -294,7 +296,7 @@ the artifact.
294
296
295
297
### ` file `
296
298
297
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2062-L2086 )
299
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2063-L2087 )
298
300
299
301
``` python
300
302
file (
@@ -319,7 +321,7 @@ Download a single file artifact to the directory you specify with `root`.
319
321
320
322
### ` files `
321
323
322
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2088-L2105 )
324
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2089-L2106 )
323
325
324
326
``` python
325
327
files(
@@ -345,7 +347,7 @@ Iterate over all files stored in this artifact.
345
347
346
348
### ` finalize `
347
349
348
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L896-L904 )
350
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L902-L910 )
349
351
350
352
``` python
351
353
finalize() -> None
@@ -360,7 +362,7 @@ when you log the artifact with `log_artifact`.
360
362
361
363
### ` get `
362
364
363
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1667-L1712 )
365
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1673-L1718 )
364
366
365
367
``` python
366
368
get(
@@ -384,7 +386,7 @@ Get the WBValue object located at the artifact relative `name`.
384
386
385
387
### ` get_added_local_path_name `
386
388
387
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1714-L1726 )
389
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1720-L1732 )
388
390
389
391
``` python
390
392
get_added_local_path_name(
@@ -404,7 +406,7 @@ Get the artifact relative name of a file added by a local filesystem path.
404
406
405
407
### ` get_entry `
406
408
407
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1646-L1665 )
409
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1652-L1671 )
408
410
409
411
``` python
410
412
get_entry(
@@ -429,7 +431,7 @@ Get the entry with the given name.
429
431
430
432
### ` get_path `
431
433
432
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1638- L1644 )
434
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1644-L1650 )
433
435
434
436
``` python
435
437
get_path(
@@ -441,7 +443,7 @@ Deprecated. Use `get_entry(name)`.
441
443
442
444
### ` is_draft `
443
445
444
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L906-L911 )
446
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L912-L917 )
445
447
446
448
``` python
447
449
is_draft() -> bool
@@ -453,7 +455,7 @@ Returns: Boolean. `False` if artifact is saved. `True` if artifact is not saved.
453
455
454
456
### ` json_encode `
455
457
456
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2337-L2344 )
458
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2338-L2345 )
457
459
458
460
``` python
459
461
json_encode() -> dict[str , Any]
@@ -467,7 +469,7 @@ Returns the artifact encoded to the JSON format.
467
469
468
470
### ` link `
469
471
470
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2176-L2204 )
472
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2177-L2205 )
471
473
472
474
``` python
473
475
link(
@@ -489,7 +491,7 @@ Link this artifact to a portfolio (a promoted collection of artifacts).
489
491
490
492
### ` logged_by `
491
493
492
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2293-L2335 )
494
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2294-L2336 )
493
495
494
496
``` python
495
497
logged_by() -> (Run | None )
@@ -507,15 +509,17 @@ Get the W&B run that originally logged the artifact.
507
509
508
510
### ` new_draft `
509
511
510
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L420-L451 )
512
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L424-L457 )
511
513
512
514
``` python
513
515
new_draft() -> Artifact
514
516
```
515
517
516
518
Create a new draft artifact with the same content as this committed artifact.
517
519
518
- The artifact returned can be extended or modified and logged as a new version.
520
+ Modifying an existing artifact creates a new artifact version known
521
+ as an "incremental artifact". The artifact returned can be extended or
522
+ modified and logged as a new version.
519
523
520
524
| Returns | |
521
525
| :--- | :--- |
@@ -527,7 +531,7 @@ The artifact returned can be extended or modified and logged as a new version.
527
531
528
532
### ` new_file `
529
533
530
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1240-L1281 )
534
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1246-L1287 )
531
535
532
536
``` python
533
537
@contextlib.contextmanager
@@ -556,7 +560,7 @@ Open a new temporary file and add it to the artifact.
556
560
557
561
### ` remove `
558
562
559
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1608-L1636 )
563
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1614-L1642 )
560
564
561
565
``` python
562
566
remove(
@@ -577,7 +581,7 @@ Remove an item from the artifact.
577
581
578
582
### ` save `
579
583
580
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L916-L955 )
584
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L922-L961 )
581
585
582
586
``` python
583
587
save(
@@ -598,7 +602,7 @@ run, a run of type "auto" is created to track this artifact.
598
602
599
603
### ` unlink `
600
604
601
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2206-L2221 )
605
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2207-L2222 )
602
606
603
607
``` python
604
608
unlink() -> None
@@ -613,7 +617,7 @@ Unlink this artifact if it is currently a member of a portfolio (a promoted coll
613
617
614
618
### ` used_by `
615
619
616
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2247-L2291 )
620
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2248-L2292 )
617
621
618
622
``` python
619
623
used_by() -> list[Run]
@@ -631,7 +635,7 @@ Get a list of the runs that have used this artifact.
631
635
632
636
### ` verify `
633
637
634
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L2022-L2060 )
638
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L2023-L2061 )
635
639
636
640
``` python
637
641
verify(
@@ -655,7 +659,7 @@ cross-referenced against the artifact's manifest. References are not verified.
655
659
656
660
### ` wait `
657
661
658
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L965-L989 )
662
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L971-L995 )
659
663
660
664
``` python
661
665
wait(
@@ -675,7 +679,7 @@ If needed, wait for this artifact to finish logging.
675
679
676
680
### ` __getitem__ `
677
681
678
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1210-L1222 )
682
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1216-L1228 )
679
683
680
684
``` python
681
685
__getitem__ (
@@ -699,7 +703,7 @@ Get the WBValue object located at the artifact relative `name`.
699
703
700
704
### ` __setitem__ `
701
705
702
- [ View source] ( https://www.github.com/wandb/wandb/tree/2678738e59629208ad4770e3d36300a272147c05 /wandb/sdk/artifacts/artifact.py#L1224-L1238 )
706
+ [ View source] ( https://www.github.com/wandb/wandb/tree/637bddf198525810add5804059001b1b319d6ad1 /wandb/sdk/artifacts/artifact.py#L1230-L1244 )
703
707
704
708
``` python
705
709
__setitem__ (
0 commit comments