Sentence Similarity
PEFT
Safetensors
English
text-embedding
embeddings
information-retrieval
beir
text-classification
language-model
text-clustering
text-semantic-similarity
text-evaluation
text-reranking
feature-extraction
Sentence Similarity
natural_questions
ms_marco
fever
hotpot_qa
mteb
Eval Results
Update README.md
Browse files
README.md
CHANGED
@@ -22,14 +22,14 @@ import torch
|
|
22 |
from transformers import AutoTokenizer, AutoModel, AutoConfig
|
23 |
from peft import PeftModel
|
24 |
|
25 |
-
# Loading base
|
26 |
-
tokenizer = AutoTokenizer.from_pretrained("McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp")
|
27 |
config = AutoConfig.from_pretrained("McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp", trust_remote_code=True)
|
28 |
model = AutoModel.from_pretrained("McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp", trust_remote_code=True, config=config, torch_dtype=torch.bfloat16)
|
29 |
model = PeftModel.from_pretrained(model, "McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp")
|
30 |
model = model.merge_and_unload() # This can take several minutes
|
31 |
|
32 |
-
# Loading supervised model
|
33 |
model = PeftModel.from_pretrained(model, "McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp-supervised")
|
34 |
|
35 |
# Wrapper for encoding and pooling operations
|
|
|
22 |
from transformers import AutoTokenizer, AutoModel, AutoConfig
|
23 |
from peft import PeftModel
|
24 |
|
25 |
+
# Loading base Mistral model, along with custom code that enables bidirectional connections in decoder-only LLMs. MNTP LoRA model are merged into the base model.
|
26 |
+
.tokenizer = AutoTokenizer.from_pretrained("McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp")
|
27 |
config = AutoConfig.from_pretrained("McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp", trust_remote_code=True)
|
28 |
model = AutoModel.from_pretrained("McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp", trust_remote_code=True, config=config, torch_dtype=torch.bfloat16)
|
29 |
model = PeftModel.from_pretrained(model, "McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp")
|
30 |
model = model.merge_and_unload() # This can take several minutes
|
31 |
|
32 |
+
# Loading supervised model. This loads the trained lora weights on top of MNTP model. Hence the final weights are -- Base model + MNTP (LoRA) + supervised (LoRA).
|
33 |
model = PeftModel.from_pretrained(model, "McGill-NLP/LLM2Vec-Mistral-7B-Instruct-v2-mntp-supervised")
|
34 |
|
35 |
# Wrapper for encoding and pooling operations
|