On the JupyterLab page, click Upload Files to upload a file. For details, see Uploading a File in Introduction to JupyterLab and Common Operations. If a message is displayed indicating that the size of the files to be uploaded exceeds the upper limit when uploading files to notebook instances or JupyterLab, you can upload the files to OBS and then download them to notebook instances.
Use the OBS API to upload large files because OBS Console has restrictions on the file size and quantity.
A notebook instance can be mounted to OBS or EVS as the storage location. The operation method varies depending on the instance types.
file_str = mox.file.read('obs://bucket_name/obs_file.txt')
with mox.file.File('obs://bucket_name/obs_file.txt', 'r') as f: file_str = f.read()
If the size of a single file exceeds 5 GB, the file cannot be uploaded in this mode. Use the MoXing API to upload large files.
Sample code:
from modelarts.session import Session session = Session() session.download_data(bucket_path="/bucket-name/dir1/sdk.txt", path="/home/user/sdk/obs.txt")
Upload files to the OBS path specified during notebook instance creation and synchronize the files from OBS to the notebook instances using Sync OBS.