Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Gestione degli endpoint di inferenza mediante il comando endpoints
Si utilizza il comando endpoints in Neptune ML per creare un endpoint di inferenza, controllarne lo stato, eliminarlo o elencare gli endpoint di inferenza esistenti.
Creazione di un endpoint di inferenza con il comando endpoints in Neptune ML
Un comando endpoints in Neptune ML per la creazione di un endpoint di inferenza da un modello creato da un processo di addestramento ha il seguente aspetto:
- 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)"
Per ulteriori informazioni, vedere create-ml-endpointnel AWS CLI Command Reference.
- 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)"
}'
Questo esempio presuppone che le AWS credenziali siano configurate nel proprio ambiente. Sostituisci us-east-1 con la regione del tuo cluster Neptune.
- 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)"
}'
Un comando endpoints in Neptune ML per l'aggiornamento di un endpoint di inferenza esistente da un modello creato da un processo di addestramento ha il seguente aspetto:
- 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)"
Per ulteriori informazioni, vedere create-ml-endpointnel AWS CLI Command Reference.
- 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)"
}'
Questo esempio presuppone che le AWS credenziali siano configurate nel proprio ambiente. Sostituisci us-east-1 con la regione del tuo cluster Neptune.
- 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)"
}'
Un comando endpoints in Neptune ML per la creazione di un endpoint di inferenza da un modello creato da un processo di trasformazione dei modelli ha il seguente aspetto:
- 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)"
Per ulteriori informazioni, vedere create-ml-endpointnel AWS CLI Command Reference.
- 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)"
}'
Questo esempio presuppone che le AWS credenziali siano configurate nel proprio ambiente. Sostituisci us-east-1 con la regione del tuo cluster Neptune.
- 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)"
}'
Un comando endpoints in Neptune ML per l'aggiornamento di un endpoint di inferenza esistente da un modello creato da un processo di trasformazione dei modelli ha il seguente aspetto:
- 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)"
Per ulteriori informazioni, vedere create-ml-endpointnel AWS CLI Command Reference.
- 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)"
}'
Questo esempio presuppone che le AWS credenziali siano configurate nel proprio ambiente. Sostituisci us-east-1 con la regione del tuo cluster Neptune.
- 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)"
}'
Parametri per il comando endpoints per la creazione di endpoint di inferenza
-
id (facoltativo): identificatore univoco per il nuovo endpoint di inferenza.
Tipo: stringa. Impostazione predefinita: nome con timestamp generato automaticamente.
-
mlModelTrainingJobId: ID del processo di addestramento dei modelli completato che ha creato il modello a cui punterà l'endpoint di inferenza.
Tipo: stringa.
Nota: è necessario specificare mlModelTrainingJobId o mlModelTransformJobId.
-
mlModelTransformJobId: ID del processo di trasformazione dei modelli completato.
Tipo: stringa.
Nota: è necessario specificare mlModelTrainingJobId o mlModelTransformJobId.
-
update (facoltativo): se presente, questo parametro indica che si tratta di una richiesta di aggiornamento.
Tipo: Boolean Default: false
Nota: è necessario specificare mlModelTrainingJobId o mlModelTransformJobId.
-
neptuneIamRoleArn— (Facoltativo) L'ARN di un ruolo IAM che fornisce a Neptune l'accesso di Neptune alle risorse AI e SageMaker Amazon S3.
Tipo: stringa. Nota: deve essere elencato nel gruppo di parametri del cluster database o si verificherà un errore.
-
modelName (facoltativo): tipo di modello per l'addestramento. Per impostazione predefinita, il modello di machine learning è basato automaticamente sul modelType utilizzato nell'elaborazione dei dati, ma qui è possibile specificare un tipo di modello diverso.
Tipo: stringa. Impostazione predefinita: rgcn per i grafi eterogenei e kge per i grafi della conoscenza. Valori validi: per i grafi eterogenei: rgcn. Per i grafi della conoscenza: kge, transe, distmult o rotate.
-
instanceType (facoltativo): tipo di istanza ML utilizzata per l'elaborazione online.
Tipo: stringa. Default: ml.m5.xlarge
Nota: la scelta dell'istanza ML per un endpoint di inferenza dipende dal tipo di attività, dalle dimensioni del grafo e dal budget. Per informazioni, consulta Selezione di un'istanza per un endpoint di inferenza.
-
instanceCount (facoltativo): numero minimo di istanze Amazon EC2 da implementare su un endpoint ai fini della previsione.
Tipo: numero intero. Default: 1
-
volumeEncryptionKMSKey— (Facoltativo) La chiave AWS Key Management Service (AWS KMS) utilizzata da SageMaker AI per crittografare i dati sul volume di storage collegato alle istanze di calcolo ML che eseguono gli endpoint.
Tipo: stringa. Impostazione predefinita: none.
Recupero dello stato di un endpoint di inferenza con il comando endpoints in Neptune ML
Un comando endpoints di esempio in Neptune ML per lo stato di un endpoint dell'istanza ha il seguente aspetto:
- AWS CLI
-
aws neptunedata get-ml-endpoint \
--endpoint-url https://your-neptune-endpoint:port \
--id "(the inference endpoint ID)"
Per ulteriori informazioni, vedere get-ml-endpointnel Command Reference. AWS CLI
- 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
Questo esempio presuppone che le AWS credenziali siano configurate nel proprio ambiente. Sostituisci us-east-1 con la regione del tuo cluster Neptune.
- curl
-
curl -s \
"https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)" \
| python -m json.tool
Parametri per il comando endpoints per lo stato dell'endpoint dell'istanza
-
id (obbligatorio): identificatore univoco dell'endpoint di inferenza.
Tipo: stringa.
-
neptuneIamRoleArn— (Facoltativo) L'ARN di un ruolo IAM che fornisce a Neptune l'accesso di Neptune alle risorse AI e SageMaker Amazon S3.
Tipo: stringa. Nota: deve essere elencato nel gruppo di parametri del cluster database o si verificherà un errore.
Eliminazione di un endpoint dell'istanza con il comando endpoints in Neptune ML
Un comando endpoints di esempio in Neptune ML per l'eliminazione di un endpoint dell'istanza ha il seguente aspetto:
- AWS CLI
-
aws neptunedata delete-ml-endpoint \
--endpoint-url https://your-neptune-endpoint:port \
--id "(the inference endpoint ID)"
Per ripulire anche gli artefatti correlati:
aws neptunedata delete-ml-endpoint \
--endpoint-url https://your-neptune-endpoint:port \
--id "(the inference endpoint ID)" \
--clean
Per ulteriori informazioni, vedere delete-ml-endpointnel AWS CLI Command Reference.
- 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
Per ripulire anche gli artefatti correlati:
awscurl "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)?clean=true" \
--region us-east-1 \
--service neptune-db \
-X DELETE
Questo esempio presuppone che le AWS credenziali siano configurate nel proprio ambiente. Sostituisci us-east-1 con la regione del tuo cluster Neptune.
- curl
-
curl -s \
-X DELETE "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)"
Oppure questo:
curl -s \
-X DELETE "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)?clean=true"
Parametri per il comando endpoints per l'eliminazione di un endpoint di inferenza
-
id (obbligatorio): identificatore univoco dell'endpoint di inferenza.
Tipo: stringa.
-
neptuneIamRoleArn— (Facoltativo) L'ARN di un ruolo IAM che fornisce a Neptune l'accesso di Neptune alle risorse AI e SageMaker Amazon S3.
Tipo: stringa. Nota: deve essere elencato nel gruppo di parametri del cluster database o si verificherà un errore.
-
clean (facoltativo): indica che devono essere eliminati anche tutti gli artefatti relativi a questo endpoint.
Tipo: Boolean Default: FALSE
Elenco degli endpoint di inferenza con il comando endpoints in Neptune ML
Un comando endpoints in Neptune ML per l'elenco degli endpoint di inferenza ha il seguente aspetto:
- AWS CLI
-
aws neptunedata list-ml-endpoints \
--endpoint-url https://your-neptune-endpoint:port
Per limitare il numero di risultati:
aws neptunedata list-ml-endpoints \
--endpoint-url https://your-neptune-endpoint:port \
--max-items 3
Per ulteriori informazioni, vedere list-ml-endpointsnel AWS CLI Command Reference.
- 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
Per limitare il numero di risultati:
awscurl "https://your-neptune-endpoint:port/ml/endpoints?maxItems=3" \
--region us-east-1 \
--service neptune-db \
-X GET
Questo esempio presuppone che le AWS credenziali siano configurate nell'ambiente in uso. Sostituisci us-east-1 con la regione del tuo cluster Neptune.
- curl
-
curl -s "https://your-neptune-endpoint:port/ml/endpoints" \
| python -m json.tool
Oppure questo:
curl -s "https://your-neptune-endpoint:port/ml/endpoints?maxItems=3" \
| python -m json.tool
Parametri per il comando dataprocessing per l'elenco degli endpoint di inferenza
-
maxItems (facoltativo): numero massimo di elementi da restituire.
Tipo: numero intero. Default: 10 Valore massimo consentito: 1024.
-
neptuneIamRoleArn— (Facoltativo) L'ARN di un ruolo IAM che fornisce a Neptune l'accesso di Neptune alle risorse AI e SageMaker Amazon S3.
Tipo: stringa. Nota: deve essere elencato nel gruppo di parametri del cluster database o si verificherà un errore.