Getting Started
This document describes how to call MoXing Framework APIs in ModelArts.
Logging In to ModelArts and Creating a Notebook Instance
- Log in to the ModelArts management console. In the left navigation pane, choose DevEnviron > Notebooks to switch to the Notebooks page.
- Click Create. On the Create Notebook page that is displayed, create a notebook instance by referring to Creating a Notebook Instance.
- After a notebook instance is created and is in the Running status, click the notebook instance name or click Open in the Operation column to go to the Jupyter development page.
- On the Files tab page, click New in the upper right corner and select the required AI engine to create a notebook file for encoding. In this example, you can create a TensorFlow file.
Figure 1 Selecting an AI engine
After the file is created, the Jupyter page is displayed by default.
Figure 2 Encoding page
Calling mox.file.
Enter the following code to implement the following simple functions:
- Introduce MoXing Framework.
- Create the test01 folder in the existing modelarts-test08/moxing directory.
- Check whether the test01 folder exists. If the folder exists, the preceding operation is successful.
1 2 3 4 |
import moxing as mox
mox.file.make_dirs('obs://modelarts-test08/moxing/test01')
mox.file.exists('obs://modelarts-test08/moxing/test01')
|
Figure 3 shows the result. Note that each time you enter a line of code, click Run. You can also go to OBS Console and check whether the test01 folder has been created in the modelarts-test08/moxing directory. For more common MoXing operations, see Sample Code for Common Operations.
Last Article: Introduction to MoXing Framework
Next Article: Introducing MoXing Framework

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.