LimYeri commited on
Commit
11083ef
·
verified ·
1 Parent(s): 47f0ec2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +88 -7
README.md CHANGED
@@ -2,21 +2,102 @@
2
  base_model: unsloth/meta-llama-3.1-8b-instruct-bnb-4bit
3
  language:
4
  - en
5
- license: apache-2.0
6
  tags:
7
  - text-generation-inference
8
  - transformers
9
  - unsloth
10
  - llama
11
  - trl
 
 
12
  ---
13
 
14
- # Uploaded model
15
 
16
- - **Developed by:** LimYeri
17
- - **License:** apache-2.0
18
- - **Finetuned from model :** unsloth/meta-llama-3.1-8b-instruct-bnb-4bit
19
 
20
- This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
21
 
22
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  base_model: unsloth/meta-llama-3.1-8b-instruct-bnb-4bit
3
  language:
4
  - en
5
+ license: mit
6
  tags:
7
  - text-generation-inference
8
  - transformers
9
  - unsloth
10
  - llama
11
  - trl
12
+ datasets:
13
+ - LimYeri/LeetCode_Python_Solutions_Data
14
  ---
15
 
16
+ # CodeMind-Llama3.1-8B-unsloth
17
 
18
+ **Codemind Project** is a language model developed to assist in solving and learning coding test problems. This model is fine-tuned using posts written by LeetCode users as training data, aiming to provide answers specialized for coding tests.
 
 
19
 
 
20
 
21
+ ## Model Information
22
+ - **Base Model**: `meta-llama/Meta-Llama-3.1-8B-Instruct`
23
+ - **Fine-Tuning**: Fine-tuned using the unsloth library based on the `unsloth/Meta-Llama-3.1-8B-Instruct` model
24
+ - **Fine-Tuning Process**: Conducted with reference to the Llama 3.1 Conversational_notebook
25
+
26
+
27
+ ## Dataset Used
28
+ - LeetCode Python Solutions Dataset: [LeetCode_Python_Solutions_Data](https://huggingface.co/datasets/LimYeri/LeetCode_Python_Solutions_Data)
29
+
30
+
31
+ ## How to Use the Model
32
+ This model is accessible through HuggingFace's model hub and can be integrated into applications using the API. It is designed to generate explanations, code snippets, or guides for coding problems or programming-related questions.
33
+
34
+ ```python
35
+ # 자세한 사항은 demo-Llama3.1.ipynb 확인
36
+ from unsloth import FastLanguageModel
37
+ from unsloth.chat_templates import get_chat_template
38
+ from IPython.display import display, Markdown
39
+
40
+ model, tokenizer = FastLanguageModel.from_pretrained(
41
+ model_name = "LimYeri/CodeMind-Llama3.1-8B-unsloth", # YOUR MODEL YOU USED FOR TRAINING
42
+ max_seq_length = max_seq_length,
43
+ dtype = dtype,
44
+ load_in_4bit = load_in_4bit,
45
+ )
46
+
47
+ tokenizer = get_chat_template(
48
+ tokenizer,
49
+ chat_template = "llama-3.1",
50
+ )
51
+ FastLanguageModel.for_inference(model) # Enable native 2x faster inference
52
+
53
+ messages = [
54
+ {"role": "system", "content": "You are a kind coding test teacher."},
55
+ {"role": "user", "content": "Enter your coding problem or question here."},
56
+ ]
57
+ inputs = tokenizer.apply_chat_template(
58
+ messages,
59
+ tokenize = True,
60
+ add_generation_prompt = True, # Must add for generation
61
+ return_tensors = "pt",
62
+ ).to("cuda")
63
+
64
+ outputs = model.generate(input_ids = inputs, max_new_tokens = 3000, use_cache = True,
65
+ temperature = 0.5, min_p = 0.3) # Feel free to adjust the temperature and min_p
66
+ text = (tokenizer.batch_decode(outputs))[0].split('assistant<|end_header_id|>\n\n')[1].strip()
67
+ display(Markdown(text))
68
+ ```
69
+
70
+ ## LoRA Configuration
71
+ - **r**: 16
72
+ - **lora_alpha**: 16
73
+ - **lora_dropout**: 0
74
+ - **bias**: "none"
75
+ - **use_gradient_checkpointing**: "unsloth"
76
+
77
+ ## Training Settings
78
+ - **Per Device Train Batch Size**: 8
79
+ - **Gradient Accumulation Steps**: 2
80
+ - **Warmup Steps**: 200
81
+ - **Number of Training Epochs**: 5
82
+ - **Learning Rate**: 2e-4
83
+ - **fp16**: not `is_bfloat16_supported()`
84
+ - **bf16**: `is_bfloat16_supported()`
85
+ - **Logging Steps**: 20
86
+ - **Optimizer**: "adamw_8bit"
87
+ - **Weight Decay**: 0.01
88
+ - **LR Scheduler Type**: "linear"
89
+
90
+ ## Evaluation Results [Open LLM Leaderboard](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard)
91
+ | Metric | Value |
92
+ |--------------|--------|
93
+ | Average | 22.17 |
94
+ | IFEval | 64.9 |
95
+ | BBH | 24.19 |
96
+ | MATH Lvl 5 | 9.97 |
97
+ | GPQA | 1.9 |
98
+ | MUSR | 6.04 |
99
+ | MMLU-PRO | 26 |
100
+
101
+
102
+ ## Fine-Tuning Code
103
+ Detailed fine-tuning code and settings can be found in the [CodeMind-Extended GitHub repository](https://github.com/LimYeri/CodeMind-Extended).