-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add MediaArtifact #520
Add MediaArtifact #520
Conversation
@andrewfrench would you like to keep this PR open? |
Yes, I'll dust this off and we can get it in. It's still useful as we expand to other media artifact types. |
599a0fd
to
5bdccdd
Compare
18b95a2
to
d062878
Compare
value: Raw bytes representing media data. | ||
name: Artifact name, generated using creation time and a random string. | ||
mime_type: The mime type of the image, like image/png or audio/wav. |
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.
Docstring appears a bit out of sync with actual fields.
artifact_type: str = field(default="media", kw_only=True, metadata={"serializable": True}) | ||
format: str = field(kw_only=True, metadata={"serializable": 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.
Do these need to be split out like this? Do they serve any purpose other than building mime_type
? I think artifact_type
is a bit confusing because it's really the media type.
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.
These attributes contribute to mime_type
as well as artifact name. Independent format
metadata in particular is useful for things like enforcing format limitations on model inputs.
c2f6650
to
2bbf49a
Compare
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.
Looks great, can you please update the changelog?
Adds a MediaArtifact class. ImageArtifact as well as future types inherit from a common MediaArtifact to capture common fields and functionality like artifact naming and MIME type support.