Add new SentenceTransformer model.
Browse files- README.md +20 -3
- model_description.json +2 -0
README.md
CHANGED
|
@@ -8,7 +8,7 @@ tags:
|
|
| 8 |
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# sbert-LaBSE-onnx
|
| 12 |
|
| 13 |
This is the ONNX version of the Sentence Transformers model sentence-transformers/LaBSE for sentence embedding, optimized for speed and lightweight performance. By utilizing onnxruntime and tokenizers instead of heavier libraries like sentence-transformers and transformers, this version ensures a smaller library size and faster execution. Below are the details of the model:
|
| 14 |
- Base model: sentence-transformers/LaBSE
|
|
@@ -30,17 +30,34 @@ Using this model becomes easy when you have [LightEmbed](https://pypi.org/projec
|
|
| 30 |
pip install -U light-embed
|
| 31 |
```
|
| 32 |
|
| 33 |
-
Then you can use the model like this:
|
| 34 |
|
| 35 |
```python
|
| 36 |
from light_embed import TextEmbedding
|
| 37 |
-
sentences = [
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
model = TextEmbedding('sentence-transformers/LaBSE')
|
| 40 |
embeddings = model.encode(sentences)
|
| 41 |
print(embeddings)
|
| 42 |
```
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
## Citing & Authors
|
| 45 |
|
| 46 |
Binh Nguyen / binhcode25@gmail.com
|
|
|
|
| 8 |
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# LightEmbed/sbert-LaBSE-onnx
|
| 12 |
|
| 13 |
This is the ONNX version of the Sentence Transformers model sentence-transformers/LaBSE for sentence embedding, optimized for speed and lightweight performance. By utilizing onnxruntime and tokenizers instead of heavier libraries like sentence-transformers and transformers, this version ensures a smaller library size and faster execution. Below are the details of the model:
|
| 14 |
- Base model: sentence-transformers/LaBSE
|
|
|
|
| 30 |
pip install -U light-embed
|
| 31 |
```
|
| 32 |
|
| 33 |
+
Then you can use the model using the original model name like this:
|
| 34 |
|
| 35 |
```python
|
| 36 |
from light_embed import TextEmbedding
|
| 37 |
+
sentences = [
|
| 38 |
+
"This is an example sentence",
|
| 39 |
+
"Each sentence is converted"
|
| 40 |
+
]
|
| 41 |
|
| 42 |
model = TextEmbedding('sentence-transformers/LaBSE')
|
| 43 |
embeddings = model.encode(sentences)
|
| 44 |
print(embeddings)
|
| 45 |
```
|
| 46 |
|
| 47 |
+
Then you can use the model using onnx model name like this:
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from light_embed import TextEmbedding
|
| 51 |
+
sentences = [
|
| 52 |
+
"This is an example sentence",
|
| 53 |
+
"Each sentence is converted"
|
| 54 |
+
]
|
| 55 |
+
|
| 56 |
+
model = TextEmbedding('LightEmbed/sbert-LaBSE-onnx')
|
| 57 |
+
embeddings = model.encode(sentences)
|
| 58 |
+
print(embeddings)
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
## Citing & Authors
|
| 62 |
|
| 63 |
Binh Nguyen / binhcode25@gmail.com
|
model_description.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"base_model": "sentence-transformers/LaBSE",
|
|
|
|
| 3 |
"embedding_dim": 768,
|
| 4 |
"max_seq_length": 256,
|
| 5 |
"model_file_size (GB)": 1.75
|
|
|
|
| 1 |
{
|
| 2 |
+
"model_name": "LightEmbed/sbert-LaBSE-onnx",
|
| 3 |
"base_model": "sentence-transformers/LaBSE",
|
| 4 |
+
"model_file": "model.onnx",
|
| 5 |
"embedding_dim": 768,
|
| 6 |
"max_seq_length": 256,
|
| 7 |
"model_file_size (GB)": 1.75
|