Use file operations to share data between your local environment and a sandbox. You can read files from a sandbox, write files to it, or mount local files and directories into it. For example, you can write a Python script to a sandbox, run it, and read the output file back to your local environment. You can also mount a directory of training data into a sandbox for a machine learning job.Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-docs-2658.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Write a file to the sandbox
Transfer a file from your local environment to the sandbox using theSandbox.write_file() method.
Sandbox class reference documentation for a full list of parameters and options for Sandbox.write_file().
Read a file from the sandbox
Save a file from the sandbox to your local environment using theSandbox.read_file() method.
Sandbox class reference documentation for a full list of parameters and options for Sandbox.read_file().
Mount a file or directory
Use mounted files to provide local files to the sandbox at creation time. UnlikeSandbox.write_file(), which transfers files to a running sandbox, mounted files are available as soon as the sandbox starts. Mounted files appear in the sandbox at the path you specify.
Mounted files are read-only in the sandbox. If you need to modify files in the sandbox, use
Sandbox.write_file() instead.train.py and requirements.txt are mounted to the sandbox root directory. The sandbox installs dependencies from requirements.txt and then runs train.py.