garystafford commited on
Commit
72f22ec
·
verified ·
1 Parent(s): fbd9bc1

Pushing LoRA adapter to Hugging Face Hub

Browse files
README.md CHANGED
@@ -7,67 +7,29 @@ tags:
7
  - trl
8
  - sft
9
  licence: license
10
- license: apache-2.0
11
- datasets:
12
- - garystafford/fine-tune-nvidia-blackwell
13
- language:
14
- - en
15
- pipeline_tag: text-generation
16
  ---
17
 
18
  # Model Card for Llama-3.2-3B-Instruct-lora-nvidia-blackwell-vllm
19
 
20
- This model is a fine-tuned version of meta-llama/Llama-3.2-3B-Instruct. It has been trained using TRL.
21
- It was trained with Low-Rank Adaptation (LoRA) and a supervised fine-tuning method within the
22
- Parameter-Efficient Fine-Tuning (PEFT) framework. This LoRA was optimized for use with vLLM.
23
-
24
-
25
 
26
  ## Quick start
27
 
28
  ```python
29
- import torch
30
- from transformers import AutoModelForCausalLM, AutoTokenizer
31
- from peft import PeftModel
32
-
33
- device = "cuda:0" if torch.cuda.is_available() else "cpu"
34
-
35
- HF_TOKEN = "<YOUR_HF_TOKEN_GOES_HERE>"
36
- base_model_id = "meta-llama/Llama-3.2-3B-Instruct"
37
- peft_model_id = "garystafford/Llama-3.2-3B-Instruct-lora-nvidia-blackwell"
38
-
39
- base_model = AutoModelForCausalLM.from_pretrained(base_model_id, token=HF_TOKEN)
40
- model = PeftModel.from_pretrained(base_model, peft_model_id).to(device)
41
- tokenizer = AutoTokenizer.from_pretrained(base_model_id, token=HF_TOKEN)
42
-
43
- test_prompt = [
44
- {
45
- "role": "user",
46
- "content": "Describe the NVIDIA Blackwell architecture.",
47
- }
48
- ]
49
 
50
- inputs = tokenizer.apply_chat_template(
51
- test_prompt,
52
- tokenize=True,
53
- add_generation_prompt=True,
54
- return_tensors="pt",
55
- ).to(device)
56
-
57
- output = model.generate(
58
- input_ids=inputs,
59
- max_new_tokens=128,
60
- temperature=0.1,
61
- pad_token_id=tokenizer.pad_token_id,
62
- ).to(device)
63
-
64
- output = tokenizer.decode(output[0], skip_special_tokens=True)
65
- output = output.split('assistant\n\n')[1].strip()
66
- print(output)
67
  ```
68
 
69
  ## Training procedure
70
 
 
 
 
71
  This model was trained with SFT.
72
 
73
  ### Framework versions
@@ -80,6 +42,8 @@ This model was trained with SFT.
80
 
81
  ## Citations
82
 
 
 
83
  Cite TRL as:
84
 
85
  ```bibtex
 
7
  - trl
8
  - sft
9
  licence: license
 
 
 
 
 
 
10
  ---
11
 
12
  # Model Card for Llama-3.2-3B-Instruct-lora-nvidia-blackwell-vllm
13
 
14
+ This model is a fine-tuned version of [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct).
15
+ It has been trained using [TRL](https://github.com/huggingface/trl).
 
 
 
16
 
17
  ## Quick start
18
 
19
  ```python
20
+ from transformers import pipeline
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
23
+ generator = pipeline("text-generation", model="garystafford/Llama-3.2-3B-Instruct-lora-nvidia-blackwell-vllm", device="cuda")
24
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
25
+ print(output["generated_text"])
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  ```
27
 
28
  ## Training procedure
29
 
30
+
31
+
32
+
33
  This model was trained with SFT.
34
 
35
  ### Framework versions
 
42
 
43
  ## Citations
44
 
45
+
46
+
47
  Cite TRL as:
48
 
49
  ```bibtex
adapter_config.json CHANGED
@@ -8,32 +8,27 @@
8
  "exclude_modules": null,
9
  "fan_in_fan_out": false,
10
  "inference_mode": true,
11
- "init_lora_weights": true,
12
  "layer_replication": null,
13
  "layers_pattern": null,
14
  "layers_to_transform": null,
15
  "loftq_config": {},
16
- "lora_alpha": 32,
17
  "lora_bias": false,
18
  "lora_dropout": 0.05,
19
  "megatron_config": null,
20
  "megatron_core": "megatron.core",
21
  "modules_to_save": null,
22
  "peft_type": "LORA",
23
- "r": 16,
24
  "rank_pattern": {},
25
  "revision": null,
26
  "target_modules": [
27
- "gate_proj",
28
- "o_proj",
29
- "down_proj",
30
- "up_proj",
31
- "k_proj",
32
- "q_proj",
33
- "v_proj"
34
  ],
35
  "task_type": "CAUSAL_LM",
36
  "trainable_token_indices": null,
37
  "use_dora": false,
38
- "use_rslora": false
39
  }
 
8
  "exclude_modules": null,
9
  "fan_in_fan_out": false,
10
  "inference_mode": true,
11
+ "init_lora_weights": "gaussian",
12
  "layer_replication": null,
13
  "layers_pattern": null,
14
  "layers_to_transform": null,
15
  "loftq_config": {},
16
+ "lora_alpha": 16,
17
  "lora_bias": false,
18
  "lora_dropout": 0.05,
19
  "megatron_config": null,
20
  "megatron_core": "megatron.core",
21
  "modules_to_save": null,
22
  "peft_type": "LORA",
23
+ "r": 64,
24
  "rank_pattern": {},
25
  "revision": null,
26
  "target_modules": [
27
+ "v_proj",
28
+ "q_proj"
 
 
 
 
 
29
  ],
30
  "task_type": "CAUSAL_LM",
31
  "trainable_token_indices": null,
32
  "use_dora": false,
33
+ "use_rslora": true
34
  }
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:29051ad9e6f2241651ac9fc27845fbd701c03b60d6f0d44533a52f206f739fa7
3
- size 97307544
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:653ee47d9f39146ae607b9b7d5a92a1f90184be0ae38b46d96d95c9baaf10d00
3
+ size 73415408
runs/May18_01-31-30_default/events.out.tfevents.1747531900.default.1325.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f40d841017fae947778587574d9ba61cf4273b5983038c9b8916599006c2ae9
3
+ size 43036
runs/May18_03-51-07_default/events.out.tfevents.1747540269.default.2105.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a71c645368cf3f720fdaa8a9079134a3209874b347e0e4c5705330e9d587205
3
+ size 43036
runs/May18_21-40-06_default/events.out.tfevents.1747604414.default.18508.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0260a9f2696d68e11bac2f476ba338b9ae8de64f7fa50e83ed81817a3b8b2022
3
+ size 43041
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2bde91c7cc438931dce25564e3184cf95163b292676333c944ae57ab90033898
3
  size 6161
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:066b86d7b059120c0663688df28e0fe88d23a92db35a313e053416f37147b2ea
3
  size 6161