Skip to content
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

Experiment.add_artifact with bytes, documentation vs code #924

Open
mrzv opened this issue Nov 20, 2023 · 2 comments
Open

Experiment.add_artifact with bytes, documentation vs code #924

mrzv opened this issue Nov 20, 2023 · 2 comments

Comments

@mrzv
Copy link

mrzv commented Nov 20, 2023

The documentation for Experiment.add_artifact suggests that it's possible to pass bytes, but it doesn't work, and I don't see it in the code. It would be tremendously useful to be able to save arbitrary bytes as an artifact. Is there a way to access this functionality?

@thequilo
Copy link
Collaborator

Hi @mrzv!

The documentation is actually correct, that's (almost) the type annotation of os.PathLike (https://docs.python.org/3/library/os.html#os.PathLike). So, you can path a file path as bytes (as stated in the docs), but no raw binary data. It's meant to log artifact files that you already created. Raw data wouldn't work with all observers (currently).

What is your use-case that you can't dump the file to disk before logging?

@mrzv
Copy link
Author

mrzv commented Nov 20, 2023

Oh, I see. I must misunderstand the meaning of bytes in this case. My use case doesn't prevent me from dumping the file to disk, it's just an extra, inconvenient step, when the data's only purpose is to land in sacred's database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants