binhcode25
commited on
Commit
•
ecc8d4e
1
Parent(s):
1434920
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-all-MiniLM-L12-v2-onnx
|
12 |
|
13 |
This is the ONNX version of the Sentence Transformers model sentence-transformers/all-MiniLM-L12-v2 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/all-MiniLM-L12-v2
|
@@ -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/all-MiniLM-L12-v2')
|
40 |
embeddings = model.encode(sentences)
|
41 |
print(embeddings)
|
42 |
```
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
## Citing & Authors
|
45 |
|
46 |
Binh Nguyen / [email protected]
|
|
|
8 |
|
9 |
---
|
10 |
|
11 |
+
# LightEmbed/sbert-all-MiniLM-L12-v2-onnx
|
12 |
|
13 |
This is the ONNX version of the Sentence Transformers model sentence-transformers/all-MiniLM-L12-v2 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/all-MiniLM-L12-v2
|
|
|
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/all-MiniLM-L12-v2')
|
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-all-MiniLM-L12-v2-onnx')
|
57 |
+
embeddings = model.encode(sentences)
|
58 |
+
print(embeddings)
|
59 |
+
```
|
60 |
+
|
61 |
## Citing & Authors
|
62 |
|
63 |
Binh Nguyen / [email protected]
|
model_description.json
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
{
|
|
|
2 |
"base_model": "sentence-transformers/all-MiniLM-L12-v2",
|
|
|
3 |
"embedding_dim": 384,
|
4 |
"max_seq_length": 128,
|
5 |
"model_file_size (GB)": 0.12
|
|
|
1 |
{
|
2 |
+
"model_name": "LightEmbed/sbert-all-MiniLM-L12-v2-onnx",
|
3 |
"base_model": "sentence-transformers/all-MiniLM-L12-v2",
|
4 |
+
"model_file": "model.onnx",
|
5 |
"embedding_dim": 384,
|
6 |
"max_seq_length": 128,
|
7 |
"model_file_size (GB)": 0.12
|