Fill-Mask
Transformers
PyTorch
Safetensors
English
bert
splade
query-expansion
document-expansion
bag-of-words
passage-retrieval
knowledge-distillation
Instructions to use baseplate/splade-cocondenser-selfdistil with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baseplate/splade-cocondenser-selfdistil with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="baseplate/splade-cocondenser-selfdistil")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("baseplate/splade-cocondenser-selfdistil") model = AutoModelForMaskedLM.from_pretrained("baseplate/splade-cocondenser-selfdistil", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -21,7 +21,7 @@ class EndpointHandler():
|
|
| 21 |
# get inputs
|
| 22 |
text = data.pop("text", data)
|
| 23 |
tokens = self.tokenizer(text, return_tensors='pt', padding=True)
|
| 24 |
-
|
| 25 |
results = []
|
| 26 |
for idx, x in enumerate(outputs.logits):
|
| 27 |
mask = tokens.attention_mask[idx]
|
|
|
|
| 21 |
# get inputs
|
| 22 |
text = data.pop("text", data)
|
| 23 |
tokens = self.tokenizer(text, return_tensors='pt', padding=True)
|
| 24 |
+
outputs = self.model(**tokens)
|
| 25 |
results = []
|
| 26 |
for idx, x in enumerate(outputs.logits):
|
| 27 |
mask = tokens.attention_mask[idx]
|