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, device_map="auto") - Notebooks
- Google Colab
- Kaggle
fix_name_or_path
#13
by tkhanipov - opened
- config.json +0 -2
- modeling_gigarembed.py +1 -1
config.json
CHANGED
|
@@ -15,7 +15,6 @@
|
|
| 15 |
"is_mask_instruction": true,
|
| 16 |
"latent_attention_config": {
|
| 17 |
"_attn_implementation_autoset": false,
|
| 18 |
-
"_name_or_path": "",
|
| 19 |
"add_cross_attention": false,
|
| 20 |
"architectures": null,
|
| 21 |
"bad_words_ids": null,
|
|
@@ -88,7 +87,6 @@
|
|
| 88 |
"padding_side": "right",
|
| 89 |
"text_config": {
|
| 90 |
"_attn_implementation_autoset": false,
|
| 91 |
-
"_name_or_path": "ai-sage/Giga-Embeddings-instruct",
|
| 92 |
"add_cross_attention": false,
|
| 93 |
"apply_qk_norm": true,
|
| 94 |
"architectures": null,
|
|
|
|
| 15 |
"is_mask_instruction": true,
|
| 16 |
"latent_attention_config": {
|
| 17 |
"_attn_implementation_autoset": false,
|
|
|
|
| 18 |
"add_cross_attention": false,
|
| 19 |
"architectures": null,
|
| 20 |
"bad_words_ids": null,
|
|
|
|
| 87 |
"padding_side": "right",
|
| 88 |
"text_config": {
|
| 89 |
"_attn_implementation_autoset": false,
|
|
|
|
| 90 |
"add_cross_attention": false,
|
| 91 |
"apply_qk_norm": true,
|
| 92 |
"architectures": null,
|
modeling_gigarembed.py
CHANGED
|
@@ -965,7 +965,7 @@ class GigarEmbedModel(PreTrainedModel):
|
|
| 965 |
|
| 966 |
# Initialize tokenizer if text config is available
|
| 967 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 968 |
-
configuration.
|
| 969 |
)
|
| 970 |
|
| 971 |
# Set configuration parameters
|
|
|
|
| 965 |
|
| 966 |
# Initialize tokenizer if text config is available
|
| 967 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 968 |
+
configuration.name_or_path
|
| 969 |
)
|
| 970 |
|
| 971 |
# Set configuration parameters
|