Help Center/ ModelArts/ DevEnviron/ Local IDE/ Local IDE (PyCharm)/ Uploading Data to a Notebook Instance Using PyCharm
Updated on 2024-08-14 GMT+08:00

Uploading Data to a Notebook Instance Using PyCharm

If the data is less than or equal to 500 MB, directly copy the data to the local IDE.

If the data is larger than 500 MB, upload the code to OBS and then to the notebook instance.

  1. Upload data to OBS. For details, see Uploading an Object.
  2. Call the mox.file.copy_parallel MoXing API provided by ModelArts in the terminal of the local IDE to transfer data from OBS to the notebook instance.
Figure 1 Uploading data to a notebook Instance through OBS

The following shows how to enable terminal in PyCharm (the operations in VS Code are similar).

Figure 2 Enabling the terminal in PyCharm

The following shows how to use MoXing in the terminal of the local IDE to download files from OBS to a development environment:

# Manually access the development environment.
cat /home/ma-user/README
# Select the source environment.
source /home/ma-user/miniconda3/bin/activate MindSpore-python3.7-aarch64
# Enter python and press Enter to enter the Python environment.
python
# Use MoXing for access.
import moxing as mox  
# Download a folder from OBS to EVS.
mox.file.copy_parallel('obs://bucket_name/sub_dir_0', '/tmp/sub_dir_0')