Text Ranking
sentence-transformers
PyTorch
JAX
ONNX
Safetensors
OpenVINO
Transformers
English
bert
text-classification
text-embeddings-inference
Instructions to use cross-encoder/stsb-TinyBERT-L4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cross-encoder/stsb-TinyBERT-L4 with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("cross-encoder/stsb-TinyBERT-L4") query = "Which planet is known as the Red Planet?" passages = [ "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.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Transformers
How to use cross-encoder/stsb-TinyBERT-L4 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cross-encoder/stsb-TinyBERT-L4") model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/stsb-TinyBERT-L4", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Commit History
-
Push tokenizer again
Verified signatureIn this PR, I'm repushing the tokenizer with a newer version of transformers, with the goal of also generating the tokenizer.json used by the `tokenizers`-backed fast tokenizers. There should not be any changes in the performance of the tokenizer, the only difference is that Transformers and Sentence Transformers can now directly use the fast tokenizer without having to convert it from the slow tokenizer. This should make loading the model faster. - Tom Aarsenf260403
-
Update model metadata
Verified signature44050b1
-
Update README.md
Verified signature1a639d4 -
Update README.md
Verified signature35262a5
-
Adding `safetensors` variant of this model (#1)
Verified signature- Adding `safetensors` variant of this model (aca3176a030158d54206212fefe9cf60de0a91ce) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>3e39595
-
Update README.md
a0fde64
-
upload flax model
57580e2 -
allow flax
2511ce7
-
upload
nreimersdb6ce33 -
initial commit
c1a44ab