Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
datasets:
|
4 |
+
- rhyliieee/notes-completion-set
|
5 |
+
base_model:
|
6 |
+
- aaditya/Llama3-OpenBioLLM-8B
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
library_name: transformers
|
9 |
+
---
|
10 |
+
Finetuned a pretrained Model with Lora, resize the base model's embeddings, then load Peft Model with the resized base model.
|
11 |
+
|
12 |
+
"""
|
13 |
+
# add special tokens to the tokenizer and base model before merging peft with base
|
14 |
+
open_tokenizer.add_special_tokens({
|
15 |
+
"additional_special_tokens": ["<|start_header_id|>", "<|end_header_id|>", "<|eot_id|>"]
|
16 |
+
})
|
17 |
+
base_model.resize_token_embeddings(len(open_tokenizer))
|
18 |
+
|
19 |
+
# reload the peft model with resized token embedding of base model
|
20 |
+
peft_model = PeftModel.from_pretrained(base_model, "rhyliieee/LLaMA3-8Bit-Lora-Med-v2",)
|
21 |
+
|
22 |
+
# perform merging
|
23 |
+
merged_peft_base_with_special_tokens = peft_model.merge_and_unload()
|
24 |
+
"""
|