Feature Extraction
sentence-transformers
Safetensors
Transformers
English
new
fill-mask
learned sparse
opensearch
retrieval
passage-retrieval
document-expansion
bag-of-words
sparse-encoder
sparse
asymmetric
inference-free
custom_code
text-embeddings-inference
Instructions to use opensearch-project/opensearch-neural-sparse-encoding-doc-v3-gte with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use opensearch-project/opensearch-neural-sparse-encoding-doc-v3-gte with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("opensearch-project/opensearch-neural-sparse-encoding-doc-v3-gte", trust_remote_code=True) queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Transformers
How to use opensearch-project/opensearch-neural-sparse-encoding-doc-v3-gte with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="opensearch-project/opensearch-neural-sparse-encoding-doc-v3-gte", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("opensearch-project/opensearch-neural-sparse-encoding-doc-v3-gte", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
zhichao-aws commited on
Commit ·
7b838cb
1
Parent(s): da2f64e
update max length
Browse files
query_0_SparseStaticEmbedding/tokenizer.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": {
|
| 4 |
"direction": "Right",
|
| 5 |
-
"max_length":
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|
|
|
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": {
|
| 4 |
"direction": "Right",
|
| 5 |
+
"max_length": 8192,
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|
query_0_SparseStaticEmbedding/tokenizer_config.json
CHANGED
|
@@ -46,8 +46,8 @@
|
|
| 46 |
"do_lower_case": true,
|
| 47 |
"extra_special_tokens": {},
|
| 48 |
"mask_token": "[MASK]",
|
| 49 |
-
"max_length":
|
| 50 |
-
"model_max_length":
|
| 51 |
"pad_to_multiple_of": null,
|
| 52 |
"pad_token": "[PAD]",
|
| 53 |
"pad_token_type_id": 0,
|
|
|
|
| 46 |
"do_lower_case": true,
|
| 47 |
"extra_special_tokens": {},
|
| 48 |
"mask_token": "[MASK]",
|
| 49 |
+
"max_length": 8192,
|
| 50 |
+
"model_max_length": 8192,
|
| 51 |
"pad_to_multiple_of": null,
|
| 52 |
"pad_token": "[PAD]",
|
| 53 |
"pad_token_type_id": 0,
|
sentence_bert_config.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"max_seq_length":
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"max_seq_length": 8192,
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|
tokenizer.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": {
|
| 4 |
"direction": "Right",
|
| 5 |
-
"max_length":
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|
|
|
|
| 2 |
"version": "1.0",
|
| 3 |
"truncation": {
|
| 4 |
"direction": "Right",
|
| 5 |
+
"max_length": 8192,
|
| 6 |
"strategy": "LongestFirst",
|
| 7 |
"stride": 0
|
| 8 |
},
|