Sentence Similarity
sentence-transformers
OpenVINO
Transformers
bert
feature-extraction
text-embeddings-inference
Instructions to use optimum-intel-internal-testing/stsb-bert-tiny-openvino with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use optimum-intel-internal-testing/stsb-bert-tiny-openvino with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("optimum-intel-internal-testing/stsb-bert-tiny-openvino") 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 optimum-intel-internal-testing/stsb-bert-tiny-openvino with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("optimum-intel-internal-testing/stsb-bert-tiny-openvino") model = AutoModel.from_pretrained("optimum-intel-internal-testing/stsb-bert-tiny-openvino", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,226 Bytes
b9993ca ad4ff54 b9993ca | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | {
"schema_version": 1,
"export_format": "openvino",
"components": {
"model": {
"file": "openvino_model.xml",
"metadata": {
"schema_version": 1,
"architecture": "_ExportableModel",
"packages": {
"transformers": "5.19.0.dev0",
"torch": "2.13.0",
"openvino": "2026.4.1"
},
"dtype": "float32",
"device": "cpu",
"kwargs": {
"input_ids": {
"rank": 2,
"shape": [
2,
16
],
"dtype": "int64"
},
"token_type_ids": {
"rank": 2,
"shape": [
2,
16
],
"dtype": "int64"
},
"attention_mask": {
"rank": 2,
"shape": [
2,
16
],
"dtype": "int64"
}
},
"input_names": [
"input_ids",
"token_type_ids",
"attention_mask"
],
"constant_inputs": {},
"output_names": [
"token_embeddings",
"sentence_embedding"
],
"num_user_outputs": 2
}
}
}
}
|