Feature Extraction
sentence-transformers
Safetensors
Transformers
Russian
English
gigarembed
MTEB
custom_code
Instructions to use ai-sage/Giga-Embeddings-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ai-sage/Giga-Embeddings-instruct with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ai-sage/Giga-Embeddings-instruct", trust_remote_code=True) 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] - Transformers
How to use ai-sage/Giga-Embeddings-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="ai-sage/Giga-Embeddings-instruct", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ai-sage/Giga-Embeddings-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
fix_name_or_path
#13
by tkhanipov - opened
No description provided.
The current version always attempts to load the tokenizer from ai-sage/Giga-Embeddings-instruct instead of using the already downloaded model directory. This leads to two problems:
- Obvious: it is impossible to run inference without access to the HF hub.
- Easy to overlook and thus dangerous: if the model changes at HF then we could run into a situation when the embedder and the tokenizer become incompatible. In the worst case scenario, this would only manifest itself in wrong embeddings.
This PR removes all _name_or_path parameters erroneously added to config.json. These are populated by transformers when loading the model. A corresponding fix to the implementation code is made so that tokenizer is loaded from the same location as the "main" model.
tkhanipov changed pull request status to open
ekolodin changed pull request status to merged
thank you!