Description Usage Arguments Value Details See Also Examples
Deploy a web service from zero or more registered models. Types of web
services that can be deployed are LocalWebservice
, which will deploy
a model locally, and AciWebservice
and AksWebservice
, which will
deploy a model to Azure Container Instances (ACI) and Azure Kubernetes
Service (AKS), respectively.The type of web service deployed will be
determined by the deployment_config
specified. Returns a Webservice
object corresponding to the deployed web service.
1 2 3 4 5 6 7 8 | deploy_model(
workspace,
name,
models,
inference_config,
deployment_config = NULL,
deployment_target = NULL
)
|
workspace |
The |
name |
A string of the name to give the deployed service. Must be unique to the workspace, only consist of lowercase letters, numbers, or dashes, start with a letter, and be between 3 and 32 characters long. |
models |
A list of |
inference_config |
The |
deployment_config |
The deployment configuration of type
|
deployment_target |
The compute target to deploy the model to.
You will only need to specify this parameter if you are deploy to AKS,
in which case provide an |
The LocalWebservice
, AciWebservice
, or AksWebservice
object.
If you encounter any issue in deploying your web service, please visit this troubleshooting guide.
inference_config()
, aci_webservice_deployment_config()
,
aks_webservice_deployment_config()
, local_webservice_deployment_config()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
ws <- load_workspace_from_config()
model <- get_model(ws, name = "my_model")
r_env <- r_environment(name = "r_env")
inference_config <- inference_config(entry_script = "score.R",
source_directory = ".",
environment = r_env)
deployment_config <- aci_webservice_deployment_config(cpu_cores = 1, memory_gb = 1)
service <- deploy_model(ws,
name = "my_webservice",
models = list(model),
inference_config = inference_config,
deployment_config = deployment_config)
wait_for_deployment(service, show_output = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.