binhcode25
commited on
Commit
•
bcb7072
1
Parent(s):
a3c665b
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 |
-
# baai-llm-embedder-onnx
|
12 |
|
13 |
This is the ONNX version of the Sentence Transformers model BAAI/llm-embedder 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: BAAI/llm-embedder
|
@@ -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('BAAI/llm-embedder')
|
40 |
embeddings = model.encode(sentences)
|
41 |
print(embeddings)
|
42 |
```
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
## Citing & Authors
|
45 |
|
46 |
Binh Nguyen / [email protected]
|
|
|
8 |
|
9 |
---
|
10 |
|
11 |
+
# LightEmbed/baai-llm-embedder-onnx
|
12 |
|
13 |
This is the ONNX version of the Sentence Transformers model BAAI/llm-embedder 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: BAAI/llm-embedder
|
|
|
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('BAAI/llm-embedder')
|
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/baai-llm-embedder-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": "BAAI/llm-embedder",
|
|
|
3 |
"embedding_dim": 768,
|
4 |
"max_seq_length": 512,
|
5 |
"model_file_size (GB)": 0.41
|
|
|
1 |
{
|
2 |
+
"model_name": "LightEmbed/baai-llm-embedder-onnx",
|
3 |
"base_model": "BAAI/llm-embedder",
|
4 |
+
"model_file": "model.onnx",
|
5 |
"embedding_dim": 768,
|
6 |
"max_seq_length": 512,
|
7 |
"model_file_size (GB)": 0.41
|