embdding
Collection
embdding model • 5 items • Updated
How to use turingevo/bge-base-zh-v1.5-openvino-8bit with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("turingevo/bge-base-zh-v1.5-openvino-8bit")
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]How to use turingevo/bge-base-zh-v1.5-openvino-8bit with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("feature-extraction", model="turingevo/bge-base-zh-v1.5-openvino-8bit") # Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("turingevo/bge-base-zh-v1.5-openvino-8bit")
model = AutoModel.from_pretrained("turingevo/bge-base-zh-v1.5-openvino-8bit")This model is a quantized version of BAAI/bge-base-zh-v1.5 and is converted to the OpenVINO format. This model was obtained via the nncf-quantization space with optimum-intel.
First make sure you have optimum-intel installed:
pip install optimum[openvino]
To load your model you can do as follows:
from optimum.intel import OVModelForFeatureExtraction
model_id = "turingevo/bge-base-zh-v1.5-openvino-8bit"
model = OVModelForFeatureExtraction.from_pretrained(model_id)
Base model
BAAI/bge-base-zh-v1.5