Instructions to use minishlab/potion-base-8m-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use minishlab/potion-base-8m-onnx with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("minishlab/potion-base-8m-onnx") - sentence-transformers
How to use minishlab/potion-base-8m-onnx with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("minishlab/potion-base-8m-onnx") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- README.md +3 -3
- model.onnx +2 -2
- tokenizer_config.json +1 -1
README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
base_model: minishlab/potion-base-8m
|
| 3 |
library_name: model2vec
|
| 4 |
license: mit
|
| 5 |
-
model_name: potion-base-
|
| 6 |
tags:
|
| 7 |
- embeddings
|
| 8 |
- static-embeddings
|
|
@@ -10,7 +10,7 @@ tags:
|
|
| 10 |
- onnx
|
| 11 |
---
|
| 12 |
|
| 13 |
-
# potion-base-
|
| 14 |
|
| 15 |
This is an ONNX export of the [minishlab/potion-base-8m](https://huggingface.co/minishlab/potion-base-8m) [Model2Vec](https://github.com/MinishLab/model2vec) model, produced with the [ONNX](https://onnx.ai/) runtime. [Model2Vec](https://github.com/MinishLab/model2vec) models use static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. This ONNX export lets you run the model with `onnxruntime` or `transformers.js`, without depending on the `model2vec` package.
|
| 16 |
|
|
@@ -22,7 +22,7 @@ This is an ONNX export of the [minishlab/potion-base-8m](https://huggingface.co/
|
|
| 22 |
import onnxruntime as ort
|
| 23 |
from transformers import AutoTokenizer
|
| 24 |
|
| 25 |
-
tokenizer = AutoTokenizer.from_pretrained("potion-base-
|
| 26 |
session = ort.InferenceSession("model.onnx")
|
| 27 |
|
| 28 |
encodings = tokenizer(["Example sentence"], padding=True, return_tensors="np")
|
|
|
|
| 2 |
base_model: minishlab/potion-base-8m
|
| 3 |
library_name: model2vec
|
| 4 |
license: mit
|
| 5 |
+
model_name: potion-base-8m_onnx
|
| 6 |
tags:
|
| 7 |
- embeddings
|
| 8 |
- static-embeddings
|
|
|
|
| 10 |
- onnx
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# potion-base-8m_onnx Model Card
|
| 14 |
|
| 15 |
This is an ONNX export of the [minishlab/potion-base-8m](https://huggingface.co/minishlab/potion-base-8m) [Model2Vec](https://github.com/MinishLab/model2vec) model, produced with the [ONNX](https://onnx.ai/) runtime. [Model2Vec](https://github.com/MinishLab/model2vec) models use static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. This ONNX export lets you run the model with `onnxruntime` or `transformers.js`, without depending on the `model2vec` package.
|
| 16 |
|
|
|
|
| 22 |
import onnxruntime as ort
|
| 23 |
from transformers import AutoTokenizer
|
| 24 |
|
| 25 |
+
tokenizer = AutoTokenizer.from_pretrained("potion-base-8m_onnx")
|
| 26 |
session = ort.InferenceSession("model.onnx")
|
| 27 |
|
| 28 |
encodings = tokenizer(["Example sentence"], padding=True, return_tensors="np")
|
model.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b955aeda5bb8eaedb3c302dc3757ad3bcbe2efc4e1b6091be21c28b3a3f392eb
|
| 3 |
+
size 30251506
|
tokenizer_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"backend": "tokenizers",
|
| 3 |
"clean_up_tokenization_spaces": false,
|
| 4 |
-
"model_max_length":
|
| 5 |
"pad_to_multiple_of": null,
|
| 6 |
"pad_token": "[PAD]",
|
| 7 |
"pad_token_type_id": 0,
|
|
|
|
| 1 |
{
|
| 2 |
"backend": "tokenizers",
|
| 3 |
"clean_up_tokenization_spaces": false,
|
| 4 |
+
"model_max_length": 512,
|
| 5 |
"pad_to_multiple_of": null,
|
| 6 |
"pad_token": "[PAD]",
|
| 7 |
"pad_token_type_id": 0,
|