Feature Extraction
sentence-transformers
Safetensors
Transformers
qwen3
text-generation
splade
sparse-encoder
code
custom_code
text-embeddings-inference
Instructions to use naver/splade-code-06B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use naver/splade-code-06B with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("naver/splade-code-06B", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use naver/splade-code-06B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="naver/splade-code-06B", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("naver/splade-code-06B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("naver/splade-code-06B", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -116,7 +116,7 @@ def prepare_tokenizer(tokenizer_name: str, padding_side="right"):
|
|
| 116 |
|
| 117 |
|
| 118 |
def get_decoder_model(
|
| 119 |
-
model_name_or_path: str, attn_implementation: str, bidirectional: bool, base_cfg
|
| 120 |
):
|
| 121 |
"""
|
| 122 |
base_cfg is the pretrained config of the underlying model
|
|
@@ -135,6 +135,7 @@ def get_decoder_model(
|
|
| 135 |
config=base_cfg,
|
| 136 |
torch_dtype=torch.bfloat16,
|
| 137 |
attn_implementation=attn_implementation,
|
|
|
|
| 138 |
)
|
| 139 |
|
| 140 |
|
|
|
|
| 116 |
|
| 117 |
|
| 118 |
def get_decoder_model(
|
| 119 |
+
model_name_or_path: str, attn_implementation: str, bidirectional: bool, base_cfg, token=None
|
| 120 |
):
|
| 121 |
"""
|
| 122 |
base_cfg is the pretrained config of the underlying model
|
|
|
|
| 135 |
config=base_cfg,
|
| 136 |
torch_dtype=torch.bfloat16,
|
| 137 |
attn_implementation=attn_implementation,
|
| 138 |
+
token=token,
|
| 139 |
)
|
| 140 |
|
| 141 |
|