View a markdown version of this page

Mengelola titik akhir inferensi menggunakan perintah endpoints - Amazon Neptune

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Mengelola titik akhir inferensi menggunakan perintah endpoints

Anda menggunakan perintah endpoints Neptune ML untuk membuat titik akhir inferensi, memeriksa statusnya, menghapus, atau membuat daftar titik akhir inferensi yang ada.

Pembuatan titik akhir inferensi menggunakan perintah endpoints Neptune ML

Perintah Neptunus endpoints Neptunus untuk membuat titik akhir inferensi dari model yang dibuat oleh pekerjaan pelatihan terlihat seperti ini:

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --ml-model-training-job-id "(the model-training job-id of a completed job)"

Untuk informasi selengkapnya, lihat create-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.create_ml_endpoint( id='(a unique ID for the new endpoint)', mlModelTrainingJobId='(the model-training job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'

Perintah Neptunus endpoints Neptunus untuk memperbarui titik akhir inferensi yang ada dari model yang dibuat oleh pekerjaan pelatihan terlihat seperti ini:

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --update \ --ml-model-training-job-id "(the model-training job-id of a completed job)"

Untuk informasi selengkapnya, lihat create-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.create_ml_endpoint( id='(a unique ID for the new endpoint)', update=True, mlModelTrainingJobId='(the model-training job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "update" : "true", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "update" : "true", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'

Perintah Neptunus endpoints Neptunus untuk membuat titik akhir inferensi dari model yang dibuat oleh pekerjaan transformasi model terlihat seperti ini:

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --ml-model-transform-job-id "(the model-transform job-id of a completed job)"

Untuk informasi selengkapnya, lihat create-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.create_ml_endpoint( id='(a unique ID for the new endpoint)', mlModelTransformJobId='(the model-transform job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'

Perintah Neptunus endpoints Neptunus untuk memperbarui titik akhir inferensi yang ada dari model yang dibuat oleh pekerjaan transformasi model terlihat seperti ini:

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --update \ --ml-model-transform-job-id "(the model-transform job-id of a completed job)"

Untuk informasi selengkapnya, lihat create-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.create_ml_endpoint( id='(a unique ID for the new endpoint)', update=True, mlModelTransformJobId='(the model-transform job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "update" : "true", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "update" : "true", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'
Parameter untuk pembuatan titik akhir inferensi endpoints
  • id   –   (Opsional) Pengidentifikasi unik untuk titik akhir inferensi baru.

    Tipe: string. Default: Nama berstampel waktu yang otomatis dihasilkan.

  • mlModelTrainingJobId— Id pekerjaan dari pekerjaan pelatihan model yang telah diselesaikan yang telah menciptakan model yang akan ditunjukkan oleh titik akhir inferensi.

    Tipe: string.

    Catatan: Anda harus menyediakan salah satu mlModelTrainingJobId ataumlModelTransformJobId.

  • mlModelTransformJobId— Id pekerjaan dari pekerjaan transformasi model yang telah selesai.

    Tipe: string.

    Catatan: Anda harus menyediakan salah satu mlModelTrainingJobId ataumlModelTransformJobId.

  • update— (Opsional) Jika ada, parameter ini menunjukkan bahwa ini adalah permintaan pembaruan.

    Tipe: Boolean. Default: false

    Catatan: Anda harus menyediakan salah satu mlModelTrainingJobId ataumlModelTransformJobId.

  • neptuneIamRoleArn— (Opsional) ARN dari peran IAM yang menyediakan akses Neptunus ke sumber daya AI dan Amazon S3. SageMaker

    Tipe: string. Catatan: Ini harus tercantum dalam grup parameter klaster DB Anda atau kesalahan akan dilemparkan.

  • modelName   –   (Opsional) Jenis model untuk latihan. Secara default model ML secara otomatis didasarkan pada modelType yang digunakan dalam pemrosesan data, tetapi Anda dapat menentukan jenis model yang berbeda di sini.

    Tipe: string. Default: rgcn untuk grafik heterogen dan kge untuk grafik pengetahuan. Nilai yang valid: Untuk grafik heterogen: rgcn. Untuk grafik pengetahuan: kge, transe, distmult, atau rotate.

  • instanceType   –   (Opsional) Jenis instans ML yang digunakan untuk servis online.

    Tipe: string. Default: ml.m5.xlarge.

    Catatan: Memilih instans ML untuk titik akhir inferensi tergantung pada jenis tugas, ukuran grafik, dan anggaran Anda. Lihat Memilih instance untuk titik akhir inferensi.

  • instanceCount   –   (Opsional) Jumlah minimum instans Amazon EC2 untuk mendeploy ke titik akhir untuk prediksi.

    Tipe: integer. Default: 1.

  • volumeEncryptionKMSKey— (Opsional) Kunci AWS Key Management Service (AWS KMS) yang digunakan SageMaker AI untuk mengenkripsi data pada volume penyimpanan yang dilampirkan ke instance komputasi HTML yang menjalankan titik akhir.

    Tipe: string. Default: tidak ada.

Mendapatkan status titik akhir inferensi menggunakan perintah endpoints Neptune ML

Perintah endpoints Neptune ML sampel untuk status titik akhir instans terlihat seperti ini:

AWS CLI
aws neptunedata get-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(the inference endpoint ID)"

Untuk informasi selengkapnya, lihat get-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.get_ml_endpoint( id='(the inference endpoint ID)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID) \ --region us-east-1 \ --service neptune-db \ -X GET
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl -s \ "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)" \ | python -m json.tool
Parameter untuk status titik akhir instans endpoints
  • id   –   (Wajib) Pengenal unik dari titik akhir inferensi.

    Tipe: string.

  • neptuneIamRoleArn— (Opsional) ARN dari peran IAM yang menyediakan akses Neptunus ke sumber daya AI dan Amazon S3. SageMaker

    Tipe: string. Catatan: Ini harus tercantum dalam grup parameter klaster DB Anda atau kesalahan akan dilemparkan.

Menghapus titik akhir instans menggunakan perintah endpoints Neptune ML

Perintah endpoints Neptune ML sampel untuk menghapus titik akhir instans terlihat seperti ini:

AWS CLI
aws neptunedata delete-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(the inference endpoint ID)"

Untuk juga membersihkan artefak terkait:

aws neptunedata delete-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(the inference endpoint ID)" \ --clean

Untuk informasi selengkapnya, lihat delete-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.delete_ml_endpoint( id='(the inference endpoint ID)', clean=True ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID) \ --region us-east-1 \ --service neptune-db \ -X DELETE

Untuk juga membersihkan artefak terkait:

awscurl "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)?clean=true" \ --region us-east-1 \ --service neptune-db \ -X DELETE
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl -s \ -X DELETE "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)"

Atau ini:

curl -s \ -X DELETE "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)?clean=true"
Parameter untuk endpoints menghapus sebuah titik akhir inferensi
  • id   –   (Wajib) Pengenal unik dari titik akhir inferensi.

    Tipe: string.

  • neptuneIamRoleArn— (Opsional) ARN dari peran IAM yang menyediakan akses Neptunus ke sumber daya AI dan Amazon S3. SageMaker

    Tipe: string. Catatan: Ini harus tercantum dalam grup parameter klaster DB Anda atau kesalahan akan dilemparkan.

  • clean— (Opsional) Menunjukkan bahwa semua artefak yang terkait dengan titik akhir ini juga harus dihapus.

    Tipe: Boolean. Default: FALSE.

Membuat daftar titik akhir inferensi menggunakan perintah endpoints Neptune ML

Perintah Neptunus Neptunus endpoints untuk mencantumkan titik akhir inferensi terlihat seperti ini:

AWS CLI
aws neptunedata list-ml-endpoints \ --endpoint-url https://your-neptune-endpoint:port

Untuk membatasi jumlah hasil:

aws neptunedata list-ml-endpoints \ --endpoint-url https://your-neptune-endpoint:port \ --max-items 3

Untuk informasi selengkapnya, lihat list-ml-endpointsdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.list_ml_endpoints( maxItems=3 ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X GET

Untuk membatasi jumlah hasil:

awscurl "https://your-neptune-endpoint:port/ml/endpoints?maxItems=3" \ --region us-east-1 \ --service neptune-db \ -X GET
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl -s "https://your-neptune-endpoint:port/ml/endpoints" \ | python -m json.tool

Atau ini:

curl -s "https://your-neptune-endpoint:port/ml/endpoints?maxItems=3" \ | python -m json.tool
Parameter untuk dataprocessing membuat daftar titik akhir inferensi
  • maxItems   –   (Opsional) Jumlah maksimum item yang akan dikembalikan.

    Tipe: integer. Default: 10. Nilai maksimum yang diperbolehkan: 1024.

  • neptuneIamRoleArn— (Opsional) ARN dari peran IAM yang menyediakan akses Neptunus ke sumber daya AI dan Amazon S3. SageMaker

    Tipe: string. Catatan: Ini harus tercantum dalam grup parameter klaster DB Anda atau kesalahan akan dilemparkan.