Update README.md
Browse files
README.md
CHANGED
@@ -1,59 +1,109 @@
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
-
|
7 |
-
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
-
|
14 |
|
15 |
-
|
16 |
-
It has been trained using [TRL](https://github.com/huggingface/trl).
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
```python
|
21 |
-
from transformers import
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
26 |
-
print(output["generated_text"])
|
27 |
-
```
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
|
32 |
|
|
|
33 |
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
-
|
37 |
|
38 |
-
|
39 |
-
- Transformers: 4.51.3
|
40 |
-
- Pytorch: 2.6.0
|
41 |
-
- Datasets: 3.5.0
|
42 |
-
- Tokenizers: 0.21.1
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
48 |
-
Cite TRL as:
|
49 |
-
|
50 |
```bibtex
|
51 |
-
@misc{
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
publisher = {GitHub},
|
57 |
-
howpublished = {\url{https://github.com/huggingface/trl}}
|
58 |
}
|
59 |
-
```
|
|
|
1 |
+
# 🧠 LoL_Build-Llama3B
|
2 |
+
|
3 |
+
A fine-tuned version of the LLaMA 3.2B model using QLoRA on a custom League of Legends build suggestion dataset. This model generates champion-specific item build recommendations based on gameplay roles and current meta.
|
4 |
+
|
5 |
---
|
6 |
+
|
7 |
+
## 📚 Dataset
|
8 |
+
|
9 |
+
- **Source**: Custom JSONL dataset with `prompt` and `completion` fields.
|
10 |
+
- **Train/Val Split**: 2 files – `train.jsonl` and `val.jsonl`
|
11 |
+
- **Schema Example**:
|
12 |
+
```json
|
13 |
+
{
|
14 |
+
"prompt": "Suggest a build for Ahri mid lane.",
|
15 |
+
"completion": "Luden's Tempest, Sorcerer's Shoes, Shadowflame..."
|
16 |
+
}
|
17 |
+
```
|
18 |
+
|
19 |
+
---
|
20 |
+
|
21 |
+
## 🏋️♂️ Training Configuration
|
22 |
+
|
23 |
+
| Hyperparameter | Value |
|
24 |
+
|----------------------------|--------------|
|
25 |
+
| Base Model | unsloth/Llama-3.2-3B-bnb-4bit |
|
26 |
+
| Batch Size | 16 |
|
27 |
+
| Gradient Accumulation | 1 |
|
28 |
+
| Epochs | 1 |
|
29 |
+
| Max Steps | 10000 |
|
30 |
+
| Learning Rate | 2e-4 |
|
31 |
+
| Weight Decay | 0.01 |
|
32 |
+
| Max Sequence Length | 512 |
|
33 |
+
| Precision | BF16 (fallback to FP16) |
|
34 |
+
| Optimizer | AdamW (8bit) |
|
35 |
+
| LoRA Rank | 16 |
|
36 |
+
| LoRA Alpha | 32 |
|
37 |
+
| LoRA Dropout | 0.05 |
|
38 |
+
|
39 |
---
|
40 |
|
41 |
+
### 📊 Evaluation
|
42 |
|
43 |
+
Trained on a single NVIDIA RTX 3060 GPU.
|
|
|
44 |
|
45 |
+
| Metric | Value |
|
46 |
+
|---------------------------|--------------------|
|
47 |
+
| **Final Eval Loss** | 0.1472 |
|
48 |
+
| **Steps Completed** | 2386 |
|
49 |
+
| **Total Epochs Trained** | 1.0 |
|
50 |
+
| **Training Batch Size** | 32 (effective) |
|
51 |
+
| **Final Learning Rate** | 1.68e-7 |
|
52 |
+
| **Final Grad Norm** | 1.64 |
|
53 |
+
| **Total FLOPs** | 6.67e+17 |
|
54 |
+
| **Eval Runtime** | 1611.14 seconds |
|
55 |
+
| **Eval Samples/sec** | 5.27 |
|
56 |
+
| **Eval Steps/sec** | 0.659 |
|
57 |
+
|
58 |
+
---
|
59 |
+
|
60 |
+
## ⚙️ Usage
|
61 |
|
62 |
```python
|
63 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
64 |
|
65 |
+
tokenizer = AutoTokenizer.from_pretrained("HatimF/LoL_Build-Llama3B")
|
66 |
+
model = AutoModelForCausalLM.from_pretrained("HatimF/LoL_Build-Llama3B")
|
|
|
|
|
|
|
67 |
|
68 |
+
prompt = "Suggest a build for Ahri in mid lane."
|
69 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
70 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
71 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
72 |
+
```
|
73 |
|
74 |
+
---
|
75 |
|
76 |
+
## 🧠 Intended Use
|
77 |
|
78 |
+
- **Primary**: Champion item build recommendation for League of Legends.
|
79 |
+
- **Limitations**:
|
80 |
+
- May hallucinate outdated items or suggest invalid builds.
|
81 |
+
- Not trained on patch-specific data.
|
82 |
|
83 |
+
---
|
84 |
|
85 |
+
## 📦 Repository Files
|
|
|
|
|
|
|
|
|
86 |
|
87 |
+
| File | Description |
|
88 |
+
|---------------------------|---------------------------------|
|
89 |
+
| `adapter_model.safetensors` | LoRA adapter weights |
|
90 |
+
| `adapter_config.json` | Configuration for LoRA |
|
91 |
+
| `generation_config.json` | Decoding hyperparameters |
|
92 |
+
| `training_args.bin` | TrainingArguments instance (Unsloth) |
|
93 |
+
| `trainer_state.json` | Logged evaluation metrics |
|
94 |
+
| `tokenizer.json` | Tokenizer vocabulary |
|
95 |
+
| `special_tokens_map.json` | Special tokens |
|
96 |
+
| `tokenizer_config.json` | Tokenizer settings |
|
97 |
|
98 |
+
---
|
99 |
|
100 |
+
## 📄 Citation
|
101 |
|
|
|
|
|
102 |
```bibtex
|
103 |
+
@misc{hatimf2025lolbuildllama3b,
|
104 |
+
title={LoL_Build-Llama3B},
|
105 |
+
author={HatimF},
|
106 |
+
year={2025},
|
107 |
+
url={https://huggingface.co/HatimF/LoL_Build-Llama3B}
|
|
|
|
|
108 |
}
|
109 |
+
```
|