Sentence Similarity
sentence-transformers
Safetensors
Transformers
English
bert_hash
feature-extraction
custom_code
Instructions to use NeuML/bert-hash-pico-embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use NeuML/bert-hash-pico-embeddings with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("NeuML/bert-hash-pico-embeddings", trust_remote_code=True) sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use NeuML/bert-hash-pico-embeddings with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("NeuML/bert-hash-pico-embeddings", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_bert_hash.py
Browse files- modeling_bert_hash.py +1 -1
modeling_bert_hash.py
CHANGED
|
@@ -266,7 +266,7 @@ class BertHashModel(BertPreTrainedModel):
|
|
| 266 |
|
| 267 |
|
| 268 |
@auto_docstring
|
| 269 |
-
class
|
| 270 |
_tied_weights_keys = {
|
| 271 |
"cls.predictions.decoder.weight": "bert.embeddings.word_embeddings.weight",
|
| 272 |
"cls.predictions.decoder.bias": "cls.predictions.bias",
|
|
|
|
| 266 |
|
| 267 |
|
| 268 |
@auto_docstring
|
| 269 |
+
class BertHashForMaskedLM(BertPreTrainedModel):
|
| 270 |
_tied_weights_keys = {
|
| 271 |
"cls.predictions.decoder.weight": "bert.embeddings.word_embeddings.weight",
|
| 272 |
"cls.predictions.decoder.bias": "cls.predictions.bias",
|