huaiwuai commited on
Commit
4727b6b
·
verified ·
1 Parent(s): c29702e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -35
README.md CHANGED
@@ -1,35 +1,37 @@
1
- ---
2
- license: apache-2.0
3
- base_model: Qwen/Qwen2.5-Coder-14B-Instruct
4
- tags:
5
- - rust
6
- - code-generation
7
- - lora
8
- language:
9
- - en
10
- - zh
11
- ---
12
-
13
- # Qwen2.5-Coder-14B-Instruct Rust LoRA
14
-
15
- LoRA fine-tuned version of Qwen2.5-Coder-14B-Instruct specifically optimized for Rust code generation. This model significantly improves Rust syntax understanding and generates 100% Rust code compared to the base model which sometimes generates Python/C++ code. Trained with Q-LoRA (4-bit quantization) on RTX 3090, achieving final loss of 0.5738.
16
-
17
- ## Usage
18
-
19
- ```python
20
- from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
21
- from peft import PeftModel
22
- import torch
23
-
24
- bnb_config = BitsAndBytesConfig(
25
- load_in_4bit=True,
26
- bnb_4bit_use_double_quant=True,
27
- bnb_4bit_quant_type="nf4",
28
- bnb_4bit_compute_dtype=torch.bfloat16
29
- )
30
-
31
- base_model = "Qwen/Qwen2.5-Coder-14B-Instruct"
32
- model = AutoModelForCausalLM.from_pretrained(base_model, quantization_config=bnb_config, device_map="auto")
33
- model = PeftModel.from_pretrained(model, "huaiwuai/Qwen2.5-Coder-14B-Instruct-Rust-LoRA")
34
- tokenizer = AutoTokenizer.from_pretrained(base_model)
35
- ```
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen2.5-Coder-14B-Instruct
4
+ tags:
5
+ - rust
6
+ - code-generation
7
+ - lora
8
+ language:
9
+ - en
10
+ - zh
11
+ datasets:
12
+ - Neloy262/rust_instruction_dataset
13
+ ---
14
+
15
+ # Qwen2.5-Coder-14B-Instruct Rust LoRA
16
+
17
+ LoRA fine-tuned version of Qwen2.5-Coder-14B-Instruct specifically optimized for Rust code generation. This model significantly improves Rust syntax understanding and generates 100% Rust code compared to the base model which sometimes generates Python/C++ code. Trained with Q-LoRA (4-bit quantization) on RTX 3090, achieving final loss of 0.5738.
18
+
19
+ ## Usage
20
+
21
+ ```python
22
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
23
+ from peft import PeftModel
24
+ import torch
25
+
26
+ bnb_config = BitsAndBytesConfig(
27
+ load_in_4bit=True,
28
+ bnb_4bit_use_double_quant=True,
29
+ bnb_4bit_quant_type="nf4",
30
+ bnb_4bit_compute_dtype=torch.bfloat16
31
+ )
32
+
33
+ base_model = "Qwen/Qwen2.5-Coder-14B-Instruct"
34
+ model = AutoModelForCausalLM.from_pretrained(base_model, quantization_config=bnb_config, device_map="auto")
35
+ model = PeftModel.from_pretrained(model, "huaiwuai/Qwen2.5-Coder-14B-Instruct-Rust-LoRA")
36
+ tokenizer = AutoTokenizer.from_pretrained(base_model)
37
+ ```