Update README.md
Browse files
README.md
CHANGED
|
@@ -6,202 +6,264 @@ tags:
|
|
| 6 |
- base_model:adapter:codellama/CodeLlama-7b-Instruct-hf
|
| 7 |
- lora
|
| 8 |
- transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# Model Card for
|
| 12 |
|
| 13 |
-
|
| 14 |
|
|
|
|
| 15 |
|
|
|
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
|
| 19 |
### Model Description
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
|
|
|
|
| 24 |
|
| 25 |
-
- **Developed by:**
|
| 26 |
-
- **Funded by
|
| 27 |
-
- **Shared by
|
| 28 |
-
- **Model type:**
|
| 29 |
-
- **Language(s) (NLP):**
|
| 30 |
-
- **License:**
|
| 31 |
-
- **Finetuned from model
|
| 32 |
|
| 33 |
-
### Model Sources
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
|
| 38 |
-
- **Paper [optional]:** [More Information Needed]
|
| 39 |
-
- **Demo [optional]:** [More Information Needed]
|
| 40 |
|
| 41 |
## Uses
|
| 42 |
|
| 43 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 44 |
-
|
| 45 |
### Direct Use
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
-
### Downstream Use
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
### Out-of-Scope Use
|
| 58 |
|
| 59 |
-
|
| 60 |
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
### Recommendations
|
| 70 |
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
|
| 74 |
|
| 75 |
## How to Get Started with the Model
|
| 76 |
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
[
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
## Training Details
|
| 82 |
|
| 83 |
### Training Data
|
| 84 |
|
| 85 |
-
|
| 86 |
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
-
|
| 90 |
|
| 91 |
-
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
-
|
| 96 |
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
#### Training Hyperparameters
|
| 99 |
|
| 100 |
-
|
| 101 |
|
| 102 |
-
#### Speeds, Sizes, Times
|
| 103 |
|
| 104 |
-
|
|
|
|
|
|
|
| 105 |
|
| 106 |
-
|
| 107 |
|
| 108 |
## Evaluation
|
| 109 |
|
| 110 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 111 |
-
|
| 112 |
### Testing Data, Factors & Metrics
|
| 113 |
|
| 114 |
#### Testing Data
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
[More Information Needed]
|
| 119 |
|
| 120 |
#### Factors
|
| 121 |
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
|
| 126 |
#### Metrics
|
| 127 |
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
[More Information Needed]
|
| 131 |
|
| 132 |
### Results
|
| 133 |
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
#### Summary
|
| 137 |
|
|
|
|
| 138 |
|
|
|
|
| 139 |
|
| 140 |
-
## Model Examination
|
| 141 |
|
| 142 |
-
|
| 143 |
|
| 144 |
-
|
| 145 |
|
| 146 |
## Environmental Impact
|
| 147 |
|
| 148 |
-
|
| 149 |
|
| 150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
|
| 152 |
-
|
| 153 |
-
- **Hours used:** [More Information Needed]
|
| 154 |
-
- **Cloud Provider:** [More Information Needed]
|
| 155 |
-
- **Compute Region:** [More Information Needed]
|
| 156 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 157 |
|
| 158 |
-
## Technical Specifications
|
| 159 |
|
| 160 |
### Model Architecture and Objective
|
| 161 |
|
| 162 |
-
|
|
|
|
|
|
|
| 163 |
|
| 164 |
### Compute Infrastructure
|
| 165 |
|
| 166 |
-
[More Information Needed]
|
| 167 |
-
|
| 168 |
#### Hardware
|
| 169 |
|
| 170 |
-
|
| 171 |
|
| 172 |
#### Software
|
| 173 |
|
| 174 |
-
|
|
|
|
|
|
|
| 175 |
|
| 176 |
-
|
| 177 |
|
| 178 |
-
|
| 179 |
|
| 180 |
**BibTeX:**
|
| 181 |
|
| 182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
**APA:**
|
| 185 |
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
## Glossary [optional]
|
| 189 |
-
|
| 190 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 191 |
|
| 192 |
-
|
| 193 |
|
| 194 |
-
##
|
| 195 |
|
| 196 |
-
|
| 197 |
|
| 198 |
-
## Model Card
|
| 199 |
|
| 200 |
-
|
| 201 |
|
| 202 |
-
|
| 203 |
|
| 204 |
-
[More Information Needed]
|
| 205 |
### Framework versions
|
| 206 |
|
| 207 |
-
|
|
|
|
| 6 |
- base_model:adapter:codellama/CodeLlama-7b-Instruct-hf
|
| 7 |
- lora
|
| 8 |
- transformers
|
| 9 |
+
- luau
|
| 10 |
+
- roblox
|
| 11 |
+
license: apache-2.0
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# Model Card for CodeLlama-7B-Instruct-Luau
|
| 17 |
|
| 18 |
+
Fine-tuned version of `codellama/CodeLlama-7b-Instruct-hf` targeted toward the **Luau** programming language, Roblox’s Lua-derived scripting language.
|
| 19 |
|
| 20 |
+
This model is distributed as a **LoRA adapter** and is intended to improve the base model’s performance on Roblox-specific scripting tasks.
|
| 21 |
|
| 22 |
+
---
|
| 23 |
|
| 24 |
## Model Details
|
| 25 |
|
| 26 |
### Model Description
|
| 27 |
|
| 28 |
+
This model is a parameter-efficient fine-tuning (LoRA) of CodeLlama 7B Instruct, specialized for generating, explaining, and refactoring **Luau** code.
|
|
|
|
| 29 |
|
| 30 |
+
The fine-tuning focuses on Roblox development patterns, including common services, APIs, gameplay scripting idioms, and client/server logic. The model is designed to assist developers during prototyping, learning, and general scripting workflows.
|
| 31 |
|
| 32 |
+
- **Developed by:** darwinkernelpanic
|
| 33 |
+
- **Funded by:** Not applicable
|
| 34 |
+
- **Shared by:** darwinkernelpanic
|
| 35 |
+
- **Model type:** Causal Language Model (decoder-only, LoRA adapter)
|
| 36 |
+
- **Language(s) (NLP):** English
|
| 37 |
+
- **License:** Apache-2.0
|
| 38 |
+
- **Finetuned from model:** codellama/CodeLlama-7b-Instruct-hf
|
| 39 |
|
| 40 |
+
### Model Sources
|
| 41 |
|
| 42 |
+
- **Repository:** https://huggingface.co/darwinkernelpanic/CodeLlama-7b-Instruct-hf-luau
|
| 43 |
+
- **Paper:** *Code Llama: Large Language Models for Code* (Meta AI)
|
| 44 |
+
- **Demo:** Not available
|
| 45 |
|
| 46 |
+
---
|
|
|
|
|
|
|
| 47 |
|
| 48 |
## Uses
|
| 49 |
|
|
|
|
|
|
|
| 50 |
### Direct Use
|
| 51 |
|
| 52 |
+
This model can be used directly for:
|
| 53 |
+
|
| 54 |
+
- Writing Luau scripts for Roblox
|
| 55 |
+
- Explaining Roblox APIs and services
|
| 56 |
+
- Refactoring or debugging Luau code
|
| 57 |
+
- Prototyping gameplay systems and utilities
|
| 58 |
+
- Learning Luau and Roblox scripting concepts
|
| 59 |
|
| 60 |
+
The model is intended as a **developer assistant**, not an autonomous system.
|
| 61 |
|
| 62 |
+
### Downstream Use
|
| 63 |
|
| 64 |
+
Potential downstream uses include:
|
| 65 |
|
| 66 |
+
- Further fine-tuning on proprietary Roblox frameworks
|
| 67 |
+
- Integration into IDEs or editor tooling
|
| 68 |
+
- Chat-based assistants for Roblox development
|
| 69 |
+
- Educational or documentation tooling
|
| 70 |
|
| 71 |
### Out-of-Scope Use
|
| 72 |
|
| 73 |
+
This model should **not** be used for:
|
| 74 |
|
| 75 |
+
- Safety-critical or production-critical systems
|
| 76 |
+
- Legal, medical, or financial advice
|
| 77 |
+
- Malware, exploit, or cheat development
|
| 78 |
+
- Fully automated code deployment without review
|
| 79 |
|
| 80 |
+
---
|
| 81 |
|
| 82 |
+
## Bias, Risks, and Limitations
|
| 83 |
|
| 84 |
+
- Inherits biases and limitations from the base CodeLlama model
|
| 85 |
+
- May hallucinate Roblox APIs or outdated behaviors
|
| 86 |
+
- Does not validate code at runtime
|
| 87 |
+
- Output correctness depends on prompt quality
|
| 88 |
|
| 89 |
### Recommendations
|
| 90 |
|
| 91 |
+
Users should:
|
| 92 |
+
|
| 93 |
+
- Review all generated code manually
|
| 94 |
+
- Test scripts in Roblox Studio
|
| 95 |
+
- Cross-check with official Roblox documentation
|
| 96 |
+
- Treat outputs as suggestions rather than authoritative solutions
|
| 97 |
|
| 98 |
+
---
|
| 99 |
|
| 100 |
## How to Get Started with the Model
|
| 101 |
|
| 102 |
+
```python
|
| 103 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 104 |
+
from peft import PeftModel
|
| 105 |
+
|
| 106 |
+
base_model = "codellama/CodeLlama-7b-Instruct-hf"
|
| 107 |
+
adapter_model = "darwinkernelpanic/CodeLlama-7b-Instruct-hf-luau"
|
| 108 |
+
|
| 109 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model)
|
| 110 |
+
model = AutoModelForCausalLM.from_pretrained(base_model)
|
| 111 |
+
model = PeftModel.from_pretrained(model, adapter_model)
|
| 112 |
+
|
| 113 |
+
prompt = "Write a Luau function that creates a Part and parents it to Workspace."
|
| 114 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 115 |
+
|
| 116 |
+
outputs = model.generate(
|
| 117 |
+
**inputs,
|
| 118 |
+
max_new_tokens=300,
|
| 119 |
+
temperature=0.7,
|
| 120 |
+
do_sample=True
|
| 121 |
+
)
|
| 122 |
|
| 123 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 124 |
+
````
|
| 125 |
+
|
| 126 |
+
---
|
| 127 |
|
| 128 |
## Training Details
|
| 129 |
|
| 130 |
### Training Data
|
| 131 |
|
| 132 |
+
The model was fine-tuned on a curated mixture of:
|
| 133 |
|
| 134 |
+
* Luau scripts
|
| 135 |
+
* Roblox API usage examples
|
| 136 |
+
* Open-source Roblox projects
|
| 137 |
+
* Synthetic instruction-style prompts
|
| 138 |
|
| 139 |
+
All data was filtered to avoid private, proprietary, or sensitive content.
|
| 140 |
|
| 141 |
+
### Training Procedure
|
| 142 |
|
| 143 |
+
The model was trained using parameter-efficient fine-tuning with LoRA while keeping the base model weights frozen.
|
| 144 |
|
| 145 |
+
#### Preprocessing
|
| 146 |
|
| 147 |
+
* Code formatting normalization
|
| 148 |
+
* Instruction-style prompt structuring
|
| 149 |
+
* Removal of low-quality or irrelevant samples
|
| 150 |
|
| 151 |
#### Training Hyperparameters
|
| 152 |
|
| 153 |
+
* **Training regime:** fp16 mixed precision
|
| 154 |
|
| 155 |
+
#### Speeds, Sizes, Times
|
| 156 |
|
| 157 |
+
* **Base model size:** ~7B parameters
|
| 158 |
+
* **Trainable parameters:** <1% (LoRA adapters only)
|
| 159 |
+
* **Adapter checkpoint size:** ~100–200 MB
|
| 160 |
|
| 161 |
+
---
|
| 162 |
|
| 163 |
## Evaluation
|
| 164 |
|
|
|
|
|
|
|
| 165 |
### Testing Data, Factors & Metrics
|
| 166 |
|
| 167 |
#### Testing Data
|
| 168 |
|
| 169 |
+
* Hand-written Luau prompts
|
| 170 |
+
* Roblox-specific scripting scenarios
|
|
|
|
| 171 |
|
| 172 |
#### Factors
|
| 173 |
|
| 174 |
+
* Luau syntax correctness
|
| 175 |
+
* Roblox API familiarity
|
| 176 |
+
* Instruction-following behavior
|
| 177 |
|
| 178 |
#### Metrics
|
| 179 |
|
| 180 |
+
* Qualitative human evaluation
|
| 181 |
+
* Manual code review and comparison with base model
|
|
|
|
| 182 |
|
| 183 |
### Results
|
| 184 |
|
| 185 |
+
The LoRA adapter demonstrates improved performance over the base model in:
|
| 186 |
+
|
| 187 |
+
* Generating idiomatic Luau
|
| 188 |
+
* Correct Roblox service usage
|
| 189 |
+
* Following game-development-oriented instructions
|
| 190 |
|
| 191 |
#### Summary
|
| 192 |
|
| 193 |
+
The model performs best when used as a Roblox development assistant and is not intended for general-purpose natural language tasks.
|
| 194 |
|
| 195 |
+
---
|
| 196 |
|
| 197 |
+
## Model Examination
|
| 198 |
|
| 199 |
+
No formal interpretability or probing analysis was conducted.
|
| 200 |
|
| 201 |
+
---
|
| 202 |
|
| 203 |
## Environmental Impact
|
| 204 |
|
| 205 |
+
Carbon emissions were not formally measured.
|
| 206 |
|
| 207 |
+
* **Hardware Type:** Consumer-grade GPU
|
| 208 |
+
* **Hours used:** < 24 hours
|
| 209 |
+
* **Cloud Provider:** None (local training)
|
| 210 |
+
* **Compute Region:** Not applicable
|
| 211 |
+
* **Carbon Emitted:** Not estimated
|
| 212 |
|
| 213 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
|
| 215 |
+
## Technical Specifications
|
| 216 |
|
| 217 |
### Model Architecture and Objective
|
| 218 |
|
| 219 |
+
* Decoder-only Transformer
|
| 220 |
+
* Next-token prediction objective
|
| 221 |
+
* LoRA adapters applied to attention layers
|
| 222 |
|
| 223 |
### Compute Infrastructure
|
| 224 |
|
|
|
|
|
|
|
| 225 |
#### Hardware
|
| 226 |
|
| 227 |
+
* Single consumer-grade GPU
|
| 228 |
|
| 229 |
#### Software
|
| 230 |
|
| 231 |
+
* PyTorch
|
| 232 |
+
* Transformers
|
| 233 |
+
* PEFT
|
| 234 |
|
| 235 |
+
---
|
| 236 |
|
| 237 |
+
## Citation
|
| 238 |
|
| 239 |
**BibTeX:**
|
| 240 |
|
| 241 |
+
```bibtex
|
| 242 |
+
@misc{darwinkernelpanic2025luau,
|
| 243 |
+
title={CodeLlama 7B Instruct Luau LoRA},
|
| 244 |
+
author={darwinkernelpanic},
|
| 245 |
+
year={2025},
|
| 246 |
+
howpublished={Hugging Face},
|
| 247 |
+
note={LoRA fine-tuned for Luau / Roblox scripting}
|
| 248 |
+
}
|
| 249 |
+
```
|
| 250 |
|
| 251 |
**APA:**
|
| 252 |
|
| 253 |
+
darwinkernelpanic. (2025). *CodeLlama 7B Instruct Luau LoRA*. Hugging Face.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
|
| 255 |
+
---
|
| 256 |
|
| 257 |
+
## Model Card Authors
|
| 258 |
|
| 259 |
+
darwinkernelpanic
|
| 260 |
|
| 261 |
+
## Model Card Contact
|
| 262 |
|
| 263 |
+
Use the Hugging Face repository issues or the author’s profile.
|
| 264 |
|
| 265 |
+
---
|
| 266 |
|
|
|
|
| 267 |
### Framework versions
|
| 268 |
|
| 269 |
+
* PEFT 0.18.0
|