-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding artifacts
section to docs
#4481
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
652e6c3
first touch
aguschin 988cebd
add info about ID
aguschin 2e62df3
Apply suggestions from code review
aguschin cb62016
working on feedback
aguschin 3185ce0
Apply suggestions from code review
aguschin 1083a64
fix style
aguschin 7dba36d
fix
aguschin 180aa10
Merge branch 'main' into artifacts
aguschin 94f845c
remove link to code
aguschin 3fc7b10
Apply suggestions from code review
aguschin 7f59fbe
Merge branch 'artifacts' of github.com:iterative/dvc.org into artifacts
aguschin eede9c0
format
aguschin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,14 @@ | |
Tracks an existing directory or file with DVC. | ||
|
||
```py | ||
def log_artifact(path: Union[str, Path]): | ||
def log_artifact( | ||
path: Union[str, Path], | ||
type: Optional[str] = None, | ||
name: Optional[str] = None, | ||
desc: Optional[str] = None, | ||
labels: Optional[List[str]] = None, | ||
meta: Optional[Dict[str, Any]] = None, | ||
): | ||
``` | ||
|
||
## Usage | ||
|
@@ -16,7 +23,13 @@ from dvclive import Live | |
Path("model.pt").write_text("weights") | ||
|
||
with Live() as live: | ||
live.log_artifact("model.pt") | ||
live.log_artifact( | ||
"model.pt", | ||
type="model", | ||
name="mymodel", | ||
desc="Fine-tuned Resnet50", | ||
labels=["resnet", "imagenet"], | ||
) | ||
``` | ||
|
||
## Description | ||
|
@@ -26,6 +39,15 @@ Uses `dvc add` to track `path` with DVC, generating a `{path}.dvc` file. | |
When combined with `save_dvc_exp=True`, it will ensure that `{path}.dvc` is | ||
included in the experiment. | ||
|
||
If `Live` was initialized with `dvcyaml=True` (which is the default), it will | ||
add an [artifact](/doc/user-guide/project-structure/dvcyaml-files#artifacts) and | ||
all the metadata passed as arguments to corresponding `dvc.yaml`. Passing | ||
aguschin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`type="model"` will mark it as a `model` for DVC and will make it appear in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... for DVC and will also make Studio Model Registry support it (coming soon!). Same as above |
||
[Studio Model Registry](/doc/studio) (coming soon). | ||
|
||
If `name` is not provided, the path stem (last part of the path without the file | ||
extension) will be used as the artifact name. | ||
|
||
## Parameters | ||
|
||
- `path` - existing directory or file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still feels a little confusing to me because:
type=data
(let's only talk about plans for things that are at least in progress already).artifacts
iftype=model
ortype=data
, which isn't true.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, sorry - I thought I fixed that. Doing it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, did that. It's ready to merge I believe.