Add new SentenceTransformer model with an onnx backend
Browse files- .gitattributes +1 -0
- 0_StaticEmbedding/model.safetensors +3 -0
- 0_StaticEmbedding/tokenizer.json +3 -0
- README.md +141 -0
- config_sentence_transformers.json +10 -0
- modules.json +8 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
0_StaticEmbedding/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
0_StaticEmbedding/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1447cd865f8f0b2dedc60d640c6279217cf5eeeed4a582365ebe8fe50df35d84
|
3 |
+
size 1024008288
|
0_StaticEmbedding/tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:249df0778f236f6ece390de0de746838ef25b9d6954b68c2ee71249e0a9d8fd4
|
3 |
+
size 17082799
|
README.md
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: sentence-transformers
|
3 |
+
pipeline_tag: sentence-similarity
|
4 |
+
tags:
|
5 |
+
- sentence-transformers
|
6 |
+
- sentence-similarity
|
7 |
+
- feature-extraction
|
8 |
+
---
|
9 |
+
|
10 |
+
# SentenceTransformer
|
11 |
+
|
12 |
+
This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
### Model Description
|
17 |
+
- **Model Type:** Sentence Transformer
|
18 |
+
<!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
|
19 |
+
- **Maximum Sequence Length:** inf tokens
|
20 |
+
- **Output Dimensionality:** 1024 tokens
|
21 |
+
- **Similarity Function:** Cosine Similarity
|
22 |
+
<!-- - **Training Dataset:** Unknown -->
|
23 |
+
<!-- - **Language:** Unknown -->
|
24 |
+
<!-- - **License:** Unknown -->
|
25 |
+
|
26 |
+
### Model Sources
|
27 |
+
|
28 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
29 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
30 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
31 |
+
|
32 |
+
### Full Model Architecture
|
33 |
+
|
34 |
+
```
|
35 |
+
SentenceTransformer(
|
36 |
+
(0): StaticEmbedding(
|
37 |
+
(embedding): EmbeddingBag(250002, 1024, mode='mean')
|
38 |
+
)
|
39 |
+
)
|
40 |
+
```
|
41 |
+
|
42 |
+
## Usage
|
43 |
+
|
44 |
+
### Direct Usage (Sentence Transformers)
|
45 |
+
|
46 |
+
First install the Sentence Transformers library:
|
47 |
+
|
48 |
+
```bash
|
49 |
+
pip install -U sentence-transformers
|
50 |
+
```
|
51 |
+
|
52 |
+
Then you can load this model and run inference.
|
53 |
+
```python
|
54 |
+
from sentence_transformers import SentenceTransformer
|
55 |
+
|
56 |
+
# Download from the 🤗 Hub
|
57 |
+
model = SentenceTransformer("juampahc/bge-m3-m2v-1024")
|
58 |
+
# Run inference
|
59 |
+
sentences = [
|
60 |
+
'The weather is lovely today.',
|
61 |
+
"It's so sunny outside!",
|
62 |
+
'He drove to the stadium.',
|
63 |
+
]
|
64 |
+
embeddings = model.encode(sentences)
|
65 |
+
print(embeddings.shape)
|
66 |
+
# [3, 1024]
|
67 |
+
|
68 |
+
# Get the similarity scores for the embeddings
|
69 |
+
similarities = model.similarity(embeddings, embeddings)
|
70 |
+
print(similarities.shape)
|
71 |
+
# [3, 3]
|
72 |
+
```
|
73 |
+
|
74 |
+
<!--
|
75 |
+
### Direct Usage (Transformers)
|
76 |
+
|
77 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
78 |
+
|
79 |
+
</details>
|
80 |
+
-->
|
81 |
+
|
82 |
+
<!--
|
83 |
+
### Downstream Usage (Sentence Transformers)
|
84 |
+
|
85 |
+
You can finetune this model on your own dataset.
|
86 |
+
|
87 |
+
<details><summary>Click to expand</summary>
|
88 |
+
|
89 |
+
</details>
|
90 |
+
-->
|
91 |
+
|
92 |
+
<!--
|
93 |
+
### Out-of-Scope Use
|
94 |
+
|
95 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
96 |
+
-->
|
97 |
+
|
98 |
+
<!--
|
99 |
+
## Bias, Risks and Limitations
|
100 |
+
|
101 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
102 |
+
-->
|
103 |
+
|
104 |
+
<!--
|
105 |
+
### Recommendations
|
106 |
+
|
107 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
108 |
+
-->
|
109 |
+
|
110 |
+
## Training Details
|
111 |
+
|
112 |
+
### Framework Versions
|
113 |
+
- Python: 3.10.12
|
114 |
+
- Sentence Transformers: 3.2.1
|
115 |
+
- Transformers: 4.45.2
|
116 |
+
- PyTorch: 2.5.0+cu121
|
117 |
+
- Accelerate: 0.34.2
|
118 |
+
- Datasets: 3.0.2
|
119 |
+
- Tokenizers: 0.20.1
|
120 |
+
|
121 |
+
## Citation
|
122 |
+
|
123 |
+
### BibTeX
|
124 |
+
|
125 |
+
<!--
|
126 |
+
## Glossary
|
127 |
+
|
128 |
+
*Clearly define terms in order to be accessible across audiences.*
|
129 |
+
-->
|
130 |
+
|
131 |
+
<!--
|
132 |
+
## Model Card Authors
|
133 |
+
|
134 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
135 |
+
-->
|
136 |
+
|
137 |
+
<!--
|
138 |
+
## Model Card Contact
|
139 |
+
|
140 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
141 |
+
-->
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.2.1",
|
4 |
+
"transformers": "4.45.2",
|
5 |
+
"pytorch": "2.5.0+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
modules.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"idx": 0,
|
4 |
+
"name": "0",
|
5 |
+
"path": "0_StaticEmbedding",
|
6 |
+
"type": "sentence_transformers.models.StaticEmbedding"
|
7 |
+
}
|
8 |
+
]
|