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
Exception
#2
by ivanstepanovftw - opened
Using code from README card raises the following exception:
Traceback (most recent call last):
File "/home/i/server/src/tools/giga.py", line 23, in <module>
model = AutoModel.from_pretrained('ai-sage/Giga-Embeddings-instruct', trust_remote_code=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/modeling_utils.py", line 3886, in from_pretrained
model = cls(config, *model_args, **model_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.cache/huggingface/modules/transformers_modules/ai-sage/Giga-Embeddings-instruct/646f5ff3587e74a18141c8d6b60d1cffd5897b92/modeling_gigarembed.py", line 331, in __init__
self.latent_attention_model = AutoModel.from_config(config.latent_attention_config).float() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 440, in from_config return model_class._from_config(config, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/modeling_utils.py", line 1494, in _from_config
if config._attn_implementation_internal is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/configuration_utils.py", line 202, in __getattribute__
return super().__getattribute__(key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'LatentAttentionConfig' object has no attribute '_attn_implementation_internal'
Python 3.12.3
sentence-transformers==3.2.1
transformers==4.45.2
please use transformers==4.46.0
Should I use 4.46.0 strctly?
I received that error with transformers == 4.47.1
please use transformers==4.46.0
Egor, are there any documents on how to structure instructions for the Giga-Embeddings-instruct model? We tried, but any added instruction causes the scores to drop
lossful changed discussion status to closed