ONNX Model Zoo

metarank/ce-esci-MiniLM-L6-v2

By metarank · ↓ 2 · ♥ 0 · Updated 2023-05-01

What's in this repo

This page lists the files in metarank/ce-esci-MiniLM-L6-v2, including pytorch_model.onnx.

  • 1 ONNX models (.onnx files)
  • 13 files, including 4 .json, 2 .py, 2 .txt, 1 .md, 1 .bin, 1 .onnx
  • Last updated 2023-05-01

ONNX files

File Size Download
pytorch_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

metarank/ce-esci-MiniLM-L6-v2

This is a sentence-transformers model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.

A cross-encoder/ms-marco-MiniLM-L-6-v2 model fine-tuned on Amazon ESCI dataset.

Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:

pip install -U sentence-transformers

Then you can use the model like this:

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer('metarank/esci-MiniLM-L6-v2')
embeddings = model.encode(sentences)
print(embeddings)

Training

The model was trained with the parameters:

DataLoader:

torch.utils.data.dataloader.DataLoader of length 769 with parameters:

{'batch_size': 128, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}

Loss:

sentence_transformers.losses.MultipleNegativesRankingLoss.MultipleNegativesRankingLoss with parameters:

{'scale': 20.0, 'similarity_fct': 'cos_sim'}

Parameters of the fit()-Method:

{
    "epochs": 1,
    "evaluation_steps": 0,
    "evaluator": "NoneType",
    "max_grad_norm": 1,
    "optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
    "optimizer_params": {
        "lr": 2e-05
    },
    "scheduler": "WarmupLinear",
    "steps_per_epoch": null,
    "warmup_steps": 1000,
    "weight_decay": 0.01
}

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
  (2): Normalize()
)

Citing & Authors

  • Roman Grebennikov

Model info

sentence-similarity sentence-transformers
sentence-transformers pytorch onnx bert feature-extraction sentence-similarity text-embeddings-inference endpoints_compatible region:us
↓ 2 ♥ 0

Created: 2023-04-12

Updated: 2023-05-01

View on Hugging Face

Files (13)

.gitattributes
.gitignore
README.md
config.json
finetune.py
onnx_convert.py
pytorch_model.bin
pytorch_model.onnx ONNX
requirements.txt
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt

Related models