.py file?If you want to use jobs or schedules function to training model with different parameter in the same time. You can modify .ipynb code to .py code and help you run the code easily.
.ipynb code and want to transfer the code to .py file..ipynb code to .py file.If you have the following ipynb file and want to transfer to python script file.
test.ipynbGo to File → Export Notebook as... → Export Notebook to Executable Script and download the .py file.
Upload test.py into jupyterlab and you will see the python script content.
test.pyRun the script to test the script is runnable.
$ python test.py
Example:
If you finish exporting Notebook to executable script have the following code:
test.pyYou want to get file_path parameter in command line arguments, then you need sys and json python package to get the arguments. After we modify the code, you will see the following code.
test.pyRun the command line and the script will read your specific file:
python test.py '{"file_path": "test.txt"}'
If you want to run the same script on different parameter in parallel, then you can change the command arguments to quickly fulfill the demand.
python test.py '{"file_path": "test.txt"}'
python test.py '{"file_path": "test2.txt"}'
python test.py '{"file_path": "test3.txt"}'
Come back to PrimeHub Platform and create a job. Please click jobs → + New Job.
Enter relevant information.