Help Center/ ModelArts/ DevEnviron/ Local IDE/ Local IDE (VS Code)/ Uploading and Downloading Files in VS Code
Updated on 2024-08-14 GMT+08:00

Uploading and Downloading Files in VS Code

Uploading Data from a Local IDE to a Notebook Instance

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 it to OBS and then to the notebook instance.

Figure 1 Uploading data to a notebook instance through OBS

Procedure

  1. Upload data to OBS. For details, see Uploading an Object. Alternatively, use ModelArts SDK on a local VS Code terminal.

    Open the terminal in the local VS Code environment.

    Figure 2 Opening the terminal in the local VS Code environment

    Enter python and press Enter to access the Python environment.

    python

    In the terminal of the local VS Code, use ModelArts SDK to upload the target local file to OBS. For details, Transferring Files.

  2. Use ModelArts SDK in the terminal of the remote VS Code environment to download the file from OBS to a development environment.
    Figure 3 Opening the terminal in the remote VS Code environment
    # Manually access the development environment using the source command.
    cat /home/ma-user/README 
    # Select the target environment.
    source /home/ma-user/miniconda3/bin/activate MindSpore-python3.7-aarch64 
    # Enter python and press Enter to access the Python environment.
    python

    Then, perform OBS transfer operations by referring to Uploading a File to OBS.

Downloading Files from a Notebook Instance to a Local Directory

Files created in Notebook can be downloaded to a local path. In the Project directory of the local IDE, right-click the Notebook2.0 project and choose Download from the shortcut menu to download the project file to the local PC.

Figure 4 Downloading files from a notebook instance to a local directory in VS Code