ONNX Model Zoo

minishlab/potion-science-8M

By minishlab · ↓ 16 · ♥ 2 · Updated 2025-01-21

What's in this repo

This page lists the files in minishlab/potion-science-8M, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 10 files, including 5 .json, 1 .md, 1 .safetensors, 1 .onnx, 1 .txt
  • Last updated 2025-01-21

ONNX files

File Size Download
onnx/model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

potion-science-8M Model Card

Model2Vec logo

This Model2Vec model is pre-trained using Tokenlearn. It is a distilled version of the baai/bge-base-en-v1.5 Sentence Transformer. It uses static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. It is designed for applications where computational resources are limited or where real-time performance is critical. This model is pre-trained on the scientific_papers dataset consisting of scientific papers from Arxiv and Pubmed.

Installation

Install model2vec using pip:

pip install model2vec

Usage

Load this model using the from_pretrained method:

from model2vec import StaticModel

# Load a pretrained Model2Vec model
model = StaticModel.from_pretrained("minishlab/potion-science-8M")

# Compute text embeddings
embeddings = model.encode(["Example sentence"])

How it works

Model2vec creates a small, static model that outperforms other static embedding models by a large margin on all tasks on MTEB. This model is pre-trained using Tokenlearn. It's created using the following steps:

  • Distillation: first, a model is distilled from a sentence transformer model using Model2Vec.
  • Training data creation: the sentence transformer model is used to create training data by creating mean output embeddings on a large corpus.
  • Training: the distilled model is trained on the training data using Tokenlearn.
  • Post-training re-regularization: after training, the model is re-regularized by weighting the tokens based on their frequency, applying PCA, and finally applying SIF weighting.

The results for this model can be found on the Model2Vec results page.

Additional Resources

Library Authors

Model2Vec was developed by the Minish Lab team consisting of Stephan Tulkens and Thomas van Dongen.

Citation

Please cite the Model2Vec repository if you use this model in your work.

@software{minishlab2024model2vec,
  authors = {Stephan Tulkens, Thomas van Dongen},
  title = {Model2Vec: Turn any Sentence Transformer into a Small Fast Model},
  year = {2024},
  url = {https://github.com/MinishLab/model2vec},
}

Model info

model2vec
model2vec onnx safetensors embeddings static-embeddings sentence-transformers license:mit region:us
↓ 16 ♥ 2

Created: 2024-11-05

Updated: 2025-01-21

View on Hugging Face

Files (10)

.gitattributes
README.md
config.json
model.safetensors
modules.json
onnx/model.onnx ONNX
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt

Related models