Help Center> ModelArts> FAQs> Notebook> Data Uploade or Download> How Do I Read and Write OBS Files in a Notebook Instance?

How Do I Read and Write OBS Files in a Notebook Instance?

MoXing is a self-developed distributed training acceleration framework used to simplify coding. It is built on the open-source deep learning engines such as TensorFlow, MXNet, PyTorch, and Keras.

MoXing provides a set of APIs for reading and writing OBS files.

Sample Code

import moxing as mox

# Download an OBS folder from OBS to a local notebook instance.
mox.file.copy_parallel('obs://bucket_name/sub_dir_0', '/tmp/sub_dir_0')

# Upload an OBS folder from a local notebook instance to OBS.
mox.file.copy_parallel('/tmp/sub_dir_0', 'obs://bucket_name/sub_dir_0')