Log files
By logging files to Neptune, you upload the contents of the file under the specified attribute in the run.
Upload files
To log files to Neptune, use the assign_files()
function.
Note that one attribute can store only one file. To log multiple files in a single call, pass multple key-value pairs to the files
dictionary:
from neptune_scale import Run
with Run(...) as run:
run.assign_files(
{
"dataset/data_sample": "sample_data.csv",
"dataset/image_sample": "input/images/img1.png",
}
)
To specify more details about the logged file, for example its MIME type and size, use the File
object:
from neptune_scale import Run
from neptune_scale.types import File
with Run(...) as run:
run.assign_files(
{
"files/file.txt": File(source=b"Hello world!", mime_type="text/plain"),
}
)
View files in the app
You can view the logged files in the Neptune app and download them directly from there.
To access the files, navigate to the Attributes tab of a selected run.
Download files with API
To download files with API, use neptune-fetcher. For details, see download_files()
.