Skip to main content

PyPAI

This is a python tool for Open Platform for AI.

Installation

pip install pypai

Demo

  1. Create and run submit.py in your project folder to generate the configuration:
from pypai import PAI

# Create a PAI cluster
pai = PAI(username='xxx', passwd='xxx')

# Generate the configuration
pai.generate_config()
  1. Open pai_configuration.json and modify it,The path of code dir MUST follows '/$PAI_DEFAULT_FS_URI/.../$PAI_USER_NAME~$PAI_JOB_NAME'. The default path is $PAI_DEFAULT_FS_URI/Users/$PAI_USER_NAME/$PAI_USER_NAME~$PAI_JOB_NAME.

  2. Change and run submit.py to submit your job:

from pypai import PAI

# Create a PAI cluster
pai = PAI(username='xxx', passwd='xxx')

# Submit job
pai.submit()

All the code in your project folder will be uploaded and your job will be submitted to the PAI.

API

class PAI:
    @paremeters:
    username: (str) PAI username
    passwd: (str) PAI password
    url: (str) PAI master node IP
    worker: (int) thread number for uploading code

function generate_config:
    @paremeters:
    jobName='test'
    image='192.168.193.253:5000/pytorch'
    dataDir=''
    outputDir=''
    codeDir='$PAI_DEFAULT_FS_URI/Users/$PAI_USER_NAME/$PAI_USER_NAME~$PAI_JOB_NAME'
    gpuType=''

function submit:
    @paremeters:
    config_path='./pai_configuration.json'
    dir_path='./'            code path
    dest_dir='/Users/'       code root path in the hdfs


Release files for pypai 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pypai 1.3
File Interpreter ABI Platform
pypai-1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / pypai-1.3-py2.py3-none-any.whl

Download URL pypai-1.3-py2.py3-none-any.whl
Size 3.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
346a73b9e877b63454a001fb096608b2b2fc0cab20d891041a9d8ae95aaca951
BLAKE2b-256 checksum
How to use checksums
4195b4dd785bdd4e165ebf41beee732c89ce13cfa3fc046ab1413ff96197489e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.29.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.3 This release

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page