Skip to main content

HSML: An environment independent client to interact with the Hopsworks Model Registry

Project description

Hopsworks Model Management

Hopsworks Community Hopsworks Model Management Documentation PyPiStatus Scala/Java Artifacts Downloads CodeStyle License

HSML is the library to interact with the Hopsworks Model Registry and Model Serving. The library makes it easy to export, manage and deploy models.

The library automatically configures itself based on the environment it is run. However, to connect from an external Python environment additional connection information, such as host and port, is required. For more information about the setup from external environments, see the setup section.

Getting Started On Hopsworks

Instantiate a connection and get the project model registry and serving handles

import hsml

# Create a connection
connection = hsml.connection()

# Get the model registry handle for the project's model registry
mr = connection.get_model_registry()

# Get the model serving handle for the current model registry
ms = connection.get_model_serving()

Create a new model

model = mr.tensorflow.create_model(name="mnist",
                                   version=1,
                                   metrics={"accuracy": 0.94},
                                   description="mnist model description")
model.save("/tmp/model_directory") # or /tmp/model_file

Download a model

model = mr.get_model("mnist", version=1)

model_path = model.download()

Delete a model

model.delete()

Get best performing model

best_model = mr.get_best_model('mnist', 'accuracy', 'max')

Deploy a model

deployment = model.deploy()

Start a deployment

deployment.start()

Make predictions with a deployed model

data = { "instances": [ model.input_example ] }

predictions = deployment.predict(data)

You can find more examples on how to use the library in examples.hopsworks.ai.

Documentation

Documentation is available at Hopsworks Model Management Documentation.

Issues

For general questions about the usage of Hopsworks Machine Learning please open a topic on Hopsworks Community.

Please report any issue using Github issue tracking.

Contributing

If you would like to contribute to this library, please see the Contribution Guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hsml-3.4.1rc0.tar.gz (55.0 kB view details)

Uploaded Source

File details

Details for the file hsml-3.4.1rc0.tar.gz.

File metadata

  • Download URL: hsml-3.4.1rc0.tar.gz
  • Upload date:
  • Size: 55.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for hsml-3.4.1rc0.tar.gz
Algorithm Hash digest
SHA256 ab4424087c589562b7a0c767566803a84c945df32fb77ffabdd0cb3b264dd839
MD5 c8f5a1bbca28b0d9bac27bce09c1e9eb
BLAKE2b-256 2d78619b4afd2277ab0682e60b1e1170d6edcd4e3d8896fcebd72662eb28a520

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page