Skip to content

Latest commit

 

History

History
119 lines (72 loc) · 4.33 KB

tests.md

File metadata and controls

119 lines (72 loc) · 4.33 KB

How to Deploy

Getting Started

You can integrate this SDK in your training logic, Jupyter notebook during experimentation, or your CI/CD system during the production environment. This SDK is also applicable for deploying existing models from your model registry or storage.

1. Install Python SDK

Тук трябва да напишем, че existing и нови модели се деплойват с питонското сдк. Минимална пайтън версия Python 3.4+

pip install teachablehub

2. Setup Deployment Keys

Тук кратка информация за деплоймънт кийс, че служат за деплой на модели, че може да се ограничават по environment за по-добро секюрити и тнт. Добри примери за deployment keys са production, staging, backenders-team, ds-team, john-dev, jane-staging etc.

{{button: { to: "/{{handler}}/{{teachable}}/deployments", type: "success", size: "small", title: "Create a new serving key" } }}

{{button: { to: "/{{handler}}/{{teachable}}/settings/deploy-keys", type: "primary", size: "medium", title: "Create a new deploy key" } }} {{button: { to: "/{{handler}}/{{teachable}}/settings/deploy-keys", type: "secondary", size: "normal", title: "Create a new deploy key" } }} {{button: { to: "/{{handler}}/{{teachable}}/settings/deploy-keys", type: "info", size: "normal", title: "Create a new deploy key" } }} {{button: { to: "/{{handler}}/{{teachable}}/settings/deploy-keys", type: "grey", size: "small", title: "Create a new deploy key" } }}

  • xsmall | small | normal | medium
  • primary | secondary | success | info | warning | danger | grey

3. Deploy a Model

{{# (deployment_framework === "sklearn")}}

{{#if(deployment_framework === "sklearn")}} {{button: { to: "/{{handler}}/{{teachable}}/settings/deploy-keys", type: "success", size: "xsmall", title: "Deploy Keys" }}} {{/}}

{{#if(deployment_environment === "production")}}

  from teachablehub.deployments.sklearn import TeachableDeployment

  # ... training logic here ...

  deployment = TeachableDeployment(
      teachable="{{handler}}/{{teachable}}",
      environment="{{deployment_environment}}",
      deploy_key="your-deploy-key-here",
  )

  deployment.model(clf)
  deployment.samples(ndarray=[X_train[0]])
  deployment.deploy(
      summary="Automatic deployment from our CI via sklearn-deploy.py",
      activate=True
  )

{{/}}

{{/}}

For the full list of features and examples checkout the following links:

For more details checkout the Python SDK on GitHub



Advanced Deployment Guide




@pivanov examples

{{button: { to: "/{{handler}}/{{teachable}}/settings/deploy-keys", type: "info", size: "xsmall", title: "Deploy Keys" } }} {{link: { to: "www.sashido.io", title: "Create", target: "_blank" } }}


handler: {{handler}}

teachable: {{teachable}}

deployment_environment: {{deployment_environment}}

deployment_framework: {{deployment_framework}}

deployment_has_features_schema: {{deployment_has_features_schema}}

deployment_version: {{deployment_version}}

deployment_ndarray_sample: {{deployment_ndarray_sample}}

deployment_has_ndarray_sample: {{deployment_has_ndarray_sample}}

deployment_features_sample: {{deployment_features_sample}}

deployment_has_features_sample: {{deployment_has_features_sample}}

deployment_status_state: {{deployment_status_state}}

deployment_prediction_result: {{deployment_prediction_result}}


Error Reason
MissingTeachableError Teachable is required for every prediction
NoThAuthMethodError Missing Serving Key param in the initializer
UnsuccessfulRequestError General Serving API errors 4xx and 5xx
UnauthorizedError Wrong Serving Key or configuration