Views
No views yet
| Parameter | Value |
|---|---|
| Base Model | meta-llama/Llama-3.1-8B-Instruct |
| Epochs | 3 |
| Learning Rate | 3e-4 |
| LR Scheduler | Cosine |
| Warmup Steps | 100 |
| Micro Batch Size | 4 |
| Gradient Accumulation Steps | 32 |
| Effective Batch Size | 512 (4 GPUs x 4 x 32) |
| Max Sequence Length | 4096 |
| Precision | BF16 |
| Parameter | Value |
|---|---|
| LoRA Rank (r) | 8 |
| LoRA Alpha | 16 |
| LoRA Dropout | 0.05 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, up_proj, down_proj, gate_proj |
ko_combined_sft_dataset.json)1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "jiwon9703/KoLlama-3.1-8B-Instruct-qlora-sft-DDP-v0"
4
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(
7 model_id,
8 torch_dtype="auto",
9 device_map="auto"
10)
11
12messages = [
13 {"role": "user", "content": "한국의 수도는 어디인가요?"}
14]
15
16input_ids = tokenizer.apply_chat_template(
17 messages,
18 add_generation_prompt=True,
19 return_tensors="pt"
20).to(model.device)
21
22outputs = model.generate(
23 input_ids,
24 max_new_tokens=512,
25 do_sample=True,
26 temperature=0.7,
27 top_p=0.9,
28)
29
30response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
31print(response)1@misc{kollama-3.1-8b-instruct-qlora,
2 author = {jiwon9703},
3 title = {KoLlama-3.1-8B-Instruct-qlora-sft-DDP-v0},
4 year = {2024},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/jiwon9703/KoLlama-3.1-8B-Instruct-qlora-sft-DDP-v0}
7}