update README.md
Browse files
README.md
CHANGED
@@ -23,8 +23,6 @@ model-index:
|
|
23 |
|
24 |
This model is a fine-tuned version of [meta-llama/Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) model. The fine-tuning was performed using Low-Rank Adaptation (LoRA) on the [LIMO dataset](https://huggingface.co/datasets/GAIR/LIMO) to enhance the model's reasoning capabilities, based on the work in the paper: [LIMO: Less is More for Reasoning](https://arxiv.org/pdf/2502.03387).
|
25 |
|
26 |
-
This repo contains the LoRA adapter weights only. The merged model can be found from [here](https://huggingface.co/t83714/llama-3.1-8b-instruct-limo).
|
27 |
-
|
28 |
## Model description
|
29 |
|
30 |
- **Base Model**: [meta-llama/Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct)
|
@@ -59,16 +57,16 @@ base_model = AutoModelForCausalLM.from_pretrained(base_model_name, torch_dtype="
|
|
59 |
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
|
60 |
|
61 |
# Load the LoRA adapter
|
62 |
-
adapter_path = "
|
63 |
model = PeftModel.from_pretrained(base_model, adapter_path)
|
64 |
|
65 |
-
prompt = "
|
66 |
|
67 |
# Tokenize the input
|
68 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
69 |
|
70 |
# Generate the output
|
71 |
-
output =
|
72 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
73 |
```
|
74 |
|
@@ -79,7 +77,11 @@ from peft import PeftModel
|
|
79 |
from transformers import AutoModelForCausalLM
|
80 |
|
81 |
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
merged_model = model.merge_and_unload()
|
84 |
merged_model.save_pretrained("./merged-model/")
|
85 |
```
|
|
|
23 |
|
24 |
This model is a fine-tuned version of [meta-llama/Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) model. The fine-tuning was performed using Low-Rank Adaptation (LoRA) on the [LIMO dataset](https://huggingface.co/datasets/GAIR/LIMO) to enhance the model's reasoning capabilities, based on the work in the paper: [LIMO: Less is More for Reasoning](https://arxiv.org/pdf/2502.03387).
|
25 |
|
|
|
|
|
26 |
## Model description
|
27 |
|
28 |
- **Base Model**: [meta-llama/Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct)
|
|
|
57 |
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
|
58 |
|
59 |
# Load the LoRA adapter
|
60 |
+
adapter_path = "t83714/llama-3.1-8b-instruct-limo-lora-adapter"
|
61 |
model = PeftModel.from_pretrained(base_model, adapter_path)
|
62 |
|
63 |
+
prompt = "How much is (2+5)x5/7"
|
64 |
|
65 |
# Tokenize the input
|
66 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
67 |
|
68 |
# Generate the output
|
69 |
+
output = model.generate(**inputs, max_length=8000)
|
70 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
71 |
```
|
72 |
|
|
|
77 |
from transformers import AutoModelForCausalLM
|
78 |
|
79 |
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
|
80 |
+
|
81 |
+
# Load the LoRA adapter
|
82 |
+
adapter_path = "t83714/llama-3.1-8b-instruct-limo-lora-adapter"
|
83 |
+
model = PeftModel.from_pretrained(base_model, adapter_path)
|
84 |
+
|
85 |
merged_model = model.merge_and_unload()
|
86 |
merged_model.save_pretrained("./merged-model/")
|
87 |
```
|