Skip to main content

The collection of building blocks to build fine-tunable similarity learning models

Project description

Quaterion Models

quaterion-models is a part of Quaterion, similarity learning framework. It is kept as a separate package to make servable models lightweight and free from training dependencies.

It contains definition of base classes, used for model inference, as well as the collection of building blocks for building fine-tunable similarity learning models. The documentation can be found here.

If you are looking for the training-related part of Quaterion, please see the main repository instead.

Install

pip install quaterion-models

It makes sense to install quaterion-models independent of the main framework if you already have trained model and only need to make inference.

Load and inference

from quaterion_models import SimilarityModel

model = SimilarityModel.load("./path/to/saved/model")

embeddings = model.encode([
    {"description": "this is an example input"},
    {"description": "you may have a different format"},
    {"description": "the output will be a numpy array"},
    {"description": "of size [batch_size, embedding_size]"},
])

Content

  • SimilarityModel - main class which contains encoder models with the head layer
  • Base class for Encoders
  • Base class and various implementations of the Head Layers
  • Additional helper functions

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

quaterion_models-0.1.19.tar.gz (17.7 kB view hashes)

Uploaded Source

Built Distribution

quaterion_models-0.1.19-py3-none-any.whl (26.2 kB view hashes)

Uploaded Python 3

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