https://github.com/qdrant/quaterion-models
The collection of bulding blocks building fine-tunable metric learning models
https://github.com/qdrant/quaterion-models
Last synced: 10 months ago
JSON representation
The collection of bulding blocks building fine-tunable metric learning models
- Host: GitHub
- URL: https://github.com/qdrant/quaterion-models
- Owner: qdrant
- License: apache-2.0
- Created: 2021-09-07T16:27:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-07T17:32:38.000Z (about 1 year ago)
- Last Synced: 2025-06-17T04:03:07.653Z (11 months ago)
- Language: Python
- Homepage: https://quaterion-models.qdrant.tech/
- Size: 3.02 MB
- Stars: 32
- Watchers: 6
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Quaterion Models
`quaterion-models` is a part of [`Quaterion`](https://github.com/qdrant/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](https://quaterion-models.qdrant.tech/).
If you are looking for the training-related part of Quaterion, please see the [main repository](https://github.com/qdrant/quaterion) instead.
## Install
```bash
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
```python
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