Text Generation
Transformers
Safetensors
GGUF
Korean
gemma4
image-text-to-text
gemma
korean
roleplay
mud
lore
llama.cpp
lmstudio
conversational
Instructions to use sangwon1472/gemma4-e2b-mud with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sangwon1472/gemma4-e2b-mud with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sangwon1472/gemma4-e2b-mud") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("sangwon1472/gemma4-e2b-mud") model = AutoModelForImageTextToText.from_pretrained("sangwon1472/gemma4-e2b-mud") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use sangwon1472/gemma4-e2b-mud with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sangwon1472/gemma4-e2b-mud", filename="gemma4-e2b-mud-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use sangwon1472/gemma4-e2b-mud with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M # Run inference directly in the terminal: llama-cli -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M # Run inference directly in the terminal: llama-cli -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
Use Docker
docker model run hf.co/sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
- LM Studio
- Jan
- vLLM
How to use sangwon1472/gemma4-e2b-mud with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sangwon1472/gemma4-e2b-mud" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sangwon1472/gemma4-e2b-mud", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
- SGLang
How to use sangwon1472/gemma4-e2b-mud with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sangwon1472/gemma4-e2b-mud" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sangwon1472/gemma4-e2b-mud", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sangwon1472/gemma4-e2b-mud" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sangwon1472/gemma4-e2b-mud", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use sangwon1472/gemma4-e2b-mud with Ollama:
ollama run hf.co/sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
- Unsloth Studio new
How to use sangwon1472/gemma4-e2b-mud with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sangwon1472/gemma4-e2b-mud to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sangwon1472/gemma4-e2b-mud to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sangwon1472/gemma4-e2b-mud to start chatting
- Docker Model Runner
How to use sangwon1472/gemma4-e2b-mud with Docker Model Runner:
docker model run hf.co/sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
- Lemonade
How to use sangwon1472/gemma4-e2b-mud with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sangwon1472/gemma4-e2b-mud:UD-Q4_K_M
Run and chat with the model
lemonade run user.gemma4-e2b-mud-UD-Q4_K_M
List all available models
lemonade list
File size: 13,113 Bytes
b7b9673 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | # Dataset Guide
์ด ๋ฌธ์๋ `gemma4-e2b-mud` ์ ์ฅ์์ ํจ๊ป ๋ค์ด ์๋ ๋ฐ์ดํฐ์
๋ฌถ์์ ์ค๋ช
ํ๋ค.
๋ชฉํ๋ ๋จ์ํ โ์ด๋ค ํ์ผ์ด ์๋คโ๋ฅผ ๋์ด์, **๊ฐ ํ์ผ์ด ์ด๋ค ์ญํ ์ ํ๋์ง**, **์ด๋ป๊ฒ ์ ๋ฆฌ๋์๋์ง**, **๋น์ทํ ๋ฐ์ดํฐ๋ฅผ ์๋ก ๋ง๋ค๋ ค๋ฉด ๋ฌด์์ ์ง์ผ์ผ ํ๋์ง**๋ฅผ ํ ๋ฒ์ ์ดํดํ ์ ์๊ฒ ํ๋ ๊ฒ์ด๋ค.
์ด ์ ์ฅ์๋ ๋ชจ๋ธ ์ ์ฅ์์ด๋ฏ๋ก, ์ฌ๊ธฐ์ ๋ฐ์ดํฐ์
์ ์๋ฐํ ๋
๋ฆฝ dataset repo ๋ผ๊ธฐ๋ณด๋ค **์ฌํ๊ณผ ํ์ฅ ์คํ์ ์ํ companion dataset bundle** ์ ๊ฐ๊น๋ค.
์ฆ, ๋ชจ๋ธ์ ์ดํดํ๊ณ ๋ค์ ํ์ตํ๊ฑฐ๋ ๋ณํํ๊ณ ์ถ์ ์ฌ๋์๊ฒ ์ค์ฉ์ ์ธ ์ถ๋ฐ์ ์ ์ ๊ณตํ๋ ๋ฐ ์ด์ ์ ๋๋ค.
## ํ๋์ ๋ณด๊ธฐ
ํฌํจ๋ ๋ํ ํ์ผ์ ์๋ ๋ค ๊ฐ์ง๋ค.
- `gemma-mud-colab-starter/dataset/combined_1000.jsonl`
- `gemma-mud-colab-starter/dataset/combined_1000.unsloth_chatml_dedup.jsonl`
- `gemma-mud-colab-starter/dataset/combined_1000.unsloth_gemma4_messages_dedup.jsonl`
- `gemma-mud-colab-starter/dataset/gemma4_mud_alpaca_100.jsonl`
์ญํ ์ ์์ฝํ๋ฉด:
- `combined_1000.jsonl`
์๋ณธ์ ๊ฐ๊น์ด 1000ํ ๋ฉ์์ง ๋ฐ์ดํฐ
- `combined_1000.unsloth_chatml_dedup.jsonl`
์ ํ ์ค๋ณต ์ ๊ฑฐ ํ ChatML ์คํ์ผ๋ก ์ ๋ฆฌํ 963ํ ํ์ต๋ณธ
- `combined_1000.unsloth_gemma4_messages_dedup.jsonl`
์์ ๊ฐ์ ๋ด์ฉ์ด์ง๋ง Gemma 4 / Unsloth ์ชฝ์์ ๋ ์์ ํ๊ฒ ์ฐ๊ธฐ ์ํ typed text messages ๋ฒ์
- `gemma4_mud_alpaca_100.jsonl`
๊ฐ์ฅ ์์ ์์์ฉ 100ํ Alpaca ๊ณ์ด ๋ฐ์ดํฐ
## ์ค์ ํฌํจ ์๋
ํ์ฌ ์ ์ฅ์์ ํฌํจ๋ ํ์ผ ๊ธฐ์ค:
- `combined_1000.jsonl`: `1000` ํ
- `combined_1000.unsloth_chatml_dedup.jsonl`: `963` ํ
- `combined_1000.unsloth_gemma4_messages_dedup.jsonl`: `963` ํ
- `gemma4_mud_alpaca_100.jsonl`: `100` ํ
์ฆ, ์๋ณธ `1000` ํ์์ **์ ํ ์ค๋ณต 37ํ์ด ์ ๊ฑฐ๋ ์ ๋ฆฌ๋ณธ**์ด ํ์ฌ ํ์ต์ฉ ๊ธฐ์ค๋ณธ์ผ๋ก ์ฐ์ธ๋ค.
## ๋ฐ์ดํฐ ํ์
## 1. `messages` ํ์ ๋ฐ์ดํฐ
`combined_1000.jsonl` ์ dedup ๋ฒ์ 2์ข
์ ๋ชจ๋ ๊ธฐ๋ณธ์ ์ผ๋ก `messages` ๊ตฌ์กฐ๋ฅผ ๋ฐ๋ฅธ๋ค.
๊ฐ๋ณ ์ํ์ ๋ณดํต ์๋ 3ํด์ผ๋ก ์ด๋ฃจ์ด์ง๋ค.
1. `system`
2. `user`
3. `assistant`
์:
```json
{
"messages": [
{
"role": "system",
"content": "๋น์ ์ ์ฐ์ฃผํญํ ํ
์คํธ MUD์ ํญ๋ก ์๋ด์์ด์ ์ธ๊ณ๊ด ํด์ค์๋ค. ๋ต๋ณ์ ํ๊ตญ์ด๋ก ํ๋ฉฐ, ์์ ์ฑ๊ณผ ์ค์ฉ์ฑ์ ํจ๊ป ์ง๋๋ค. ํ๋ ์ด์ ๋์์ด ๋๋ ์ ๋ณด์ ๋ถ์๊ธฐ ๋ฌ์ฌ๋ฅผ ํจ๊ป ์ค๋ค."
},
{
"role": "user",
"content": "First Fire Horizon์ด ์ด๋ค ๊ณณ์ธ์ง ์ค๋ช
ํด์ค."
},
{
"role": "assistant",
"content": "First Fire Horizon์ ์์ ๊ฑฐ์ ์ผ๋ก, ๋ถ์ ์๊ด๊ณผ ์ค๋๋ ๊ธฐ๋์์ด ๋จ์ ์๋ ์ถํญ์ ๋ถ์๊ธฐ๊ฐ ๊ฐ๋๋ ์ฅ์๋ค."
}
]
}
```
### Typed text messages ๋ฒ์
`combined_1000.unsloth_gemma4_messages_dedup.jsonl` ์์๋ `content` ๊ฐ ๋จ์ ๋ฌธ์์ด์ด ์๋๋ผ ์๋์ฒ๋ผ ๋ค์ด๊ฐ๋ค.
```json
{
"role": "user",
"content": [
{
"type": "text",
"text": "First Fire Horizon์ด ์ด๋ค ๊ณณ์ธ์ง ์ค๋ช
ํด์ค."
}
]
}
```
์ด ๋ฒ์ ์ Gemma 4 ๊ณ์ด์ ํ
ํ๋ฆฟ/processor ๊ฒฝ๋ก์์ `content` ํ์
ํด์์ด ๋ ๋ช
ํํด์ง๋๋ก ์ค๋นํ ํ์ผ์ด๋ค.
## 2. Alpaca ๊ณ์ด ์์ ๋ฐ์ดํฐ
`gemma4_mud_alpaca_100.jsonl` ์ ์๋ ํ๋๋ฅผ ๊ฐ์ง ์ํ ์์ ๋ฐ์ดํฐ๋ค.
- `instruction`
- `input`
- `output`
- `text`
์:
```json
{
"instruction": "look",
"input": "",
"output": "๋น์ ์ ์ฒซ ๋ถ์ ์งํ์ ๊ด์ธก ๊ฐํ์ ์ ์๋ค. ..."
}
```
์ด ํ์ผ์ ๊ตฌ์กฐ๊ฐ ๋จ์ํด์ ์ค๋ช
๊ณผ ์ฒซ ์คํ์๋ ์ข์ง๋ง, Gemma 4 / Unsloth ๊ธฐ์ค์ ์ค์ ์ด์ ์คํ์์๋ `messages` ํ์ ์ชฝ์ด ๋ ์์ฐ์ค๋ฝ๋ค.
## ๋ฐ์ดํฐ์ ๊ฒฐ
ํ์ฌ `combined_1000.unsloth_chatml_dedup.jsonl` ๊ธฐ์ค์ ๊ด์ฐฐ๊ฐ์ ์๋์ ๊ฐ๋ค.
- ์ด ํ ์: `963`
- ์ญํ ์:
- `system`: `963`
- `user`: `963`
- `assistant`: `963`
- ํ๊ท user ๊ธธ์ด: ์ฝ `33.0` ๋ฌธ์
- ํ๊ท assistant ๊ธธ์ด: ์ฝ `114.6` ๋ฌธ์
- ์ต๋ user ๊ธธ์ด: `60`
- ์ต๋ assistant ๊ธธ์ด: `362`
- ๊ณ ์ system prompt ์: `4`
์ฆ, ์ด ๋ฐ์ดํฐ์
์ ๊ธธ๊ณ ๋ณต์กํ multi-turn ๋ํ๊ฐ ์๋๋ผ, **์งง์ ๋จ์ผ ์์ฒญ -> ๋น๊ต์ ์งง์ ๋๋ต** ๊ตฌ์กฐ๋ฅผ ์ค์ฌ์ผ๋ก ํ๋ค.
## system prompt ๋ถํฌ
์ ๋ฆฌ๋ณธ ๊ธฐ์ค์ผ๋ก system prompt ๋ 4์ข
์ด๋ค.
1. ํญ๋ก ์๋ด์ / ์ธ๊ณ๊ด ํด์ค์: `250`
2. NPC ๋์ฌ ์์ฑ์: `250`
3. ํ์คํธ ๋ฐ ์์คํ
๋ฉ์์ง ์์ฑ์: `250`
4. ํ๊ฒฝ ์์ ๊ฐ: `213`
์ด ๋ถํฌ๋ฅผ ๋ณด๋ฉด ๋ฐ์ดํฐ์
์ด ๋จ์ผ ๋ฌธ์ฒด๋ง ๋ฐ์ด๋ถ์ด๋ ํํ๋ ์๋๋ค.
๋์ ์๋ ๋ค ์ธต์ ํจ๊ป ํ์ตํ๋๋ก ์ค๊ณ๋์ด ์๋ค.
- lore / setting explanation
- NPC voice
- quest / system flavor text
- environment / look / scan narration
## ์ฌ์ฉ์ ์
๋ ฅ ๊ฒฝํฅ
์ ๋ฆฌ๋ณธ์์ ์์ฃผ ๋ณด์ด๋ ์
๋ ฅ ํค์๋ ์์๋ ์๋์ ๊ฐ๋ค.
- `์ ํธ`: `60`
- `ํ์คํธ`: `50`
- `์๋ฌธ`: `50`
- `์ฐ๋ฃ`: `48`
- `ํญ๋ก`: `33`
- `ํ์ง๋ฑ`: `22`
- `๋ํน`: `20`
- `ํํ`: `18`
- `์๋ฆฌ`: `14`
- `๊ฑฐ๋`: `14`
- `์ ํฌ`: `10`
์ด ๋ถํฌ๋ ์ด ๋ฐ์ดํฐ์
์ด ๋จ์ง โ๋ก์ด ์ค๋ช
โ๋ง ๋ชจ์๋ ๊ฒ์ด ์๋๋ผ, ์ค์ ํ
์คํธ MUD์์ ์์ฃผ ๋์ค๋ ์๋ ์
๋ ฅ๊ตฐ์ ํจ๊ป ํฌํจํ๋ค๋ ๋ป์ด๋ค.
- ์ฅ์ ์ค๋ช
- ์ ํธ/์ค์บ
- ํ์คํธ์ ์์คํ
ํ
์คํธ
- ํญ๋ก/๋ํน/์ฐ๋ฃ ๊ฐ์ ํ๋ ์ด ๊ด๋ จ ํํ
- ํํ/์๋ฌธ/๊ฑฐ๋ ๋ฑ ์ธ๊ณ ์ํธ์์ฉ
## ์ด ๋ฐ์ดํฐ์
์ด ์ํ๋ ๊ฒ
- ์งง๊ณ ๋ถ์๊ธฐ ์๋ ์๋ต
- ํ๊ตญ์ด ์ธ๊ณ๊ด ์ค๋ช
- MUD ํค์ NPC ๋ํ
- room look / signal / rumor ๊ฐ์ ์งง์ ๋ช
๋ น ๋ฐ์
- ์ค์ ๋ฌธ์ฅ๊ณผ ๊ธฐ๋ฅ ์ค๋ช
์ด ์์ธ ํ
์คํธ
## ์ด ๋ฐ์ดํฐ์
๋ง์ผ๋ก๋ ๋ถ์กฑํ ๊ฒ
์ด ๋ฐ์ดํฐ์
์ โ์์ง ๋์ฒดโ๊ฐ ์๋๋ผ โ์์ฌ ๋ ์ด์ด ๋ณด๊ฐโ์ ๋ชฉํ๋ก ํ๋ฏ๋ก, ์๋๋ ์๋์ ์ผ๋ก ์ฝํ๊ฑฐ๋ ๋น์์ ธ ์๋ ์์ญ์ด๋ค.
- ์ ๋ฐํ ์ํ ์ถ์
- ์์น ๊ธฐ๋ฐ ์ ํฌ ๊ท์น
- ๋ณด์ ๊ณ์ฐ
- ํ์คํธ ์๋ฃ ํ์
- ์ฅ๊ธฐ multi-turn ๋ฉ๋ชจ๋ฆฌ
- ์ผ๋ฐ ์์ QA
์ฆ, ๋ชจ๋ธ์ด ์๋๋ฅผ ์ํ๊ฒ ํ๊ณ ์ถ๋ค๋ฉด ๋ณ๋ ๋ฐ์ดํฐ๊ฐ ๋ ํ์ํ๋ค.
- ์ฅ๊ธฐ ๋ํ
- ์์ธ ์ธ๊ณ ๊ท์น ์ค์
- ์๊ฒฉํ JSON ์ถ๋ ฅ
- ํด ํธ์ถ / ํจ์ ํธ์ถ
- ์ ํฌ ๋ก๊ทธ ํด์ค
## ์ dedup ๋ฒ์ ์ด ํ์ํ๊ฐ
์๋ณธ `1000` ํ์ ๊ทธ๋๋ก ์ฐ๋ฉด, ์ ํํ ๊ฐ์ ์ค์ด ๋ฐ๋ณต๋๋ ์ํ์ด ๋ค์ด๊ฐ ์๋ค.
์ ์ ๊ท๋ชจ์ ๋ฏธ์ธ์กฐ์ ์์๋ ์ด๋ฐ ์ค๋ณต์ด ํน์ ํํ์ ๊ณผํ๊ฒ ๊ฐํํด์, ๋ชจ๋ธ์ด ์ค์ ๋ณด๋ค ๋ ์ข์ ๋ฌธ์ฒด๋ฅผ ๋ด๋๋ก ๋ง๋ค ์ ์๋ค.
๊ทธ๋์ ์ ๋ฆฌ๋ณธ์์๋:
- exact duplicate ์ ๊ฑฐ
- ๊ณต๋ฐฑ/์ค๋ฐ๊ฟ ์ ๋ฆฌ
- role/content ๊ตฌ์กฐ ๊ฒ์ฆ
- Gemma 4์ฉ typed text messages ๋ฒ์ ์ถ๊ฐ
๋ฅผ ๊ฑฐ์น `963` ํ์ ๊ธฐ์ค๋ณธ์ผ๋ก ์ผ์๋ค.
## ์ ChatML ๋ฒ์ ๊ณผ Gemma 4 typed ๋ฒ์ ์ ๋ ๋ค ๋๋๊ฐ
๋์ ๋ด์ฉ์ ์ฌ์ค์ ๊ฐ์ง๋ง, ์ฉ๋๊ฐ ๋ค๋ฅด๋ค.
### `combined_1000.unsloth_chatml_dedup.jsonl`
- ์ฌ๋์ด ์ฝ๊ธฐ ํธํ๋ค
- ์ผ๋ฐ์ ์ธ chat fine-tuning ํฌ๋งท๊ณผ ๊ฐ๊น๋ค
- ๋๋ฒ๊น
์ด ์ฝ๋ค
### `combined_1000.unsloth_gemma4_messages_dedup.jsonl`
- Gemma 4 processor/template ๊ฒฝ๋ก์์ ๋ ์์ ํ๋ค
- `content: [{type: "text", text: ...}]` ๊ตฌ์กฐ๋ฅผ ๊ฐ์ ํ ์ ์๋ค
- multimodal ๊ณ์ด ํ
ํ๋ฆฟ๊ณผ์ ์ถฉ๋์ ์ค์ด๊ธฐ ์ฝ๋ค
์ค์ ์์๋ typed messages ๋ฒ์ ์ ๊ธฐ์ค์ผ๋ก ๋๊ณ , ํ์ํ๋ฉด ์ต์ข
`text` ์ปฌ๋ผ์ ๋ง๋ค์ด ํ์ตํ๋ ํธ์ด ์์ ์ ์ด๋ค.
## ์ด ๋ฐ์ดํฐ์
์ผ๋ก ์ ์ํ์ ๋ง๋ค ๋์ ๊ท์น
์ ๋ฐ์ดํฐ๋ฅผ ์ถ๊ฐํ ๋๋ ์๋ ๊ท์น์ ์ถ์ฒํ๋ค.
### 1. ๊ธฐ๋ณธ ๋จ์๋ 1์ํ = 1system + 1user + 1assistant
๊ฐ๋ฅํ๋ฉด ์๋ 3ํด ๊ตฌ์กฐ๋ฅผ ์ ์งํ๋ค.
- `system`: ์ญํ ๊ณผ ๋งํฌ
- `user`: ์งง๊ณ ๋ช
ํํ ์
๋ ฅ
- `assistant`: ์งง๊ณ ํค์ด ์ด์ ์๋ ๋ต๋ณ
### 2. user๋ ์งง๊ฒ, assistant๋ ์์ถ๋๊ฒ
์ด ๋ฐ์ดํฐ์
์ ๊ฐ์ ์ โ์งง์ ์
๋ ฅ์ ์งง๊ณ ์ ๋ช
ํ ์ถ๋ ฅโ์ด๋ค.
๋ฐ๋ผ์ ์ ์ํ๋ ์๋ ๊ฒฐ์ ์ ์งํ๋ ํธ์ด ์ข๋ค.
- user: ์งง์ ๋ช
๋ น, ์งง์ ์์ฒญ, ํ ๋ฌธ์ฅ ์ง๋ฌธ
- assistant: ๋์ธ ๋ฌธ๋จ ์ดํ, ๊ฐ๋ฅํ๋ฉด ์งง์ ์์ ์ค์ฌ
### 3. ์์คํ
์ญํ ์ ์์ด๋ผ
ํ์ฌ ๋ถํฌ์ฒ๋ผ ์๋ ๋ค ์ญํ ์ ๊ณ ๋ฅด๊ฒ ์๋ ํธ์ด ์ข๋ค.
- ์ธ๊ณ๊ด ํด์ค์
- NPC ๋์ฌ ์์ฑ์
- ํ์คํธ/์์คํ
๋ฉ์์ง ์์ฑ์
- ํ๊ฒฝ ์์ ๊ฐ
ํ ์ญํ ๋ง ๋ชฐ์ ๋ฃ์ผ๋ฉด ๋ฌธ์ฒด๊ฐ ํ์ชฝ์ผ๋ก๋ง ์ ๋ฆฌ๊ธฐ ์ฝ๋ค.
### 4. ์์ง ํ์ ์ ์ง์ ์ ์ธํ์ง ๋ง๋ผ
๋ชจ๋ธ์ด ์๋๋ฅผ ์ง์ ์ ์ธํ๋ ์ํ์ ๊ฐ๊ธ์ ํผํ๋ค.
- ํ์คํธ ์๋ฃ
- ๋ณด์ ํ๋
- ๋ฌธ ์ด๋ฆผ
- ์ ํฌ ์น๋ฆฌ ํ์
์ด๋ฐ ๋ฌธ์ฅ์ ๋์ค์ ๋ชจ๋ธ์ด ๊ฒ์ ์์ง ์ญํ ๊น์ง ๋๋ณด๊ฒ ๋ง๋ค ์ ์๋ค.
### 5. ํ์ค ์์ ๊ฐ์๋ณด๋ค ์ธ๊ณ ์์ ๋ฐ์์ ์ฐ์ ํ๋ผ
์ด ๋ฐ์ดํฐ์
์ ๋ชฉ์ ์ ๋ฒ์ฉ ๋ฐฑ๊ณผ์ฌ์ QA๊ฐ ์๋๋ค.
๋ฐ๋ผ์ `Oracle`, `signal`, `route` ๊ฐ์ ๋จ์ด๊ฐ ๋์๋ ํ์ค ๊ธฐ์ ๋ฌธ์ํ ์ค๋ช
์ด ์๋๋ผ **์ธ๊ณ๊ด ๋ด๋ถ ๋ฐ์**์ด ๋์ค๋๋ก ์์ฑํ๋ ํธ์ด ์ข๋ค.
## ์ถ์ฒ ์์ฑ ํ
ํ๋ฆฟ
๊ฐ์ฅ ๋ฌด๋ํ ์์ฑ ํ
ํ๋ฆฟ์ ์๋์ ๊ฐ๋ค.
```json
{
"messages": [
{
"role": "system",
"content": "๋น์ ์ ์ฐ์ฃผํญํ ํ
์คํธ MUD์ ํ๊ฒฝ ์์ ๊ฐ๋ค. ๋ต๋ณ์ ํ๊ตญ์ด๋ก ํ๋ฉฐ, room look, scan, ์ด๋ ๋ฉ์์ง, ์ํ ๊ฒฝ๊ณ ๋ฅผ ์ ๋ช
ํ๊ณ ํ๋ ์ด ์นํ์ ์ผ๋ก ์์ฑํ๋ค."
},
{
"role": "user",
"content": "scan signal"
},
{
"role": "assistant",
"content": "์์ ๊ธฐ์๋ ๋ถ์์ง ๋งฅ๋ ํ๋๊ฐ ๋ฎ๊ฒ ๊ฑธ๋ฆฐ๋ค. ์ ํธ๋ ์ค๋์ ์ ๋๊ฒผ์ง๋ง, ๋์๋ฝ์๋ ์์ง๋ ๋๊ตฐ๊ฐ์ ํธ์ถ ์ต๊ด ๊ฐ์ ๊ท์น์ด ๋จ์ ์๋ค."
}
]
}
```
Gemma 4 typed messages ๋ฒ์ ์ผ๋ก ๋ฐ๋ก ๋ง๋ค๊ณ ์ถ์ผ๋ฉด:
```json
{
"messages": [
{
"role": "system",
"content": [{"type": "text", "text": "๋น์ ์ ์ฐ์ฃผํญํ ํ
์คํธ MUD์ NPC ๋์ฌ ์์ฑ์๋ค. ๋ต๋ณ์ ํ๊ตญ์ด๋ก ํ๋ฉฐ, ์ญํ ์ ๋ง๋ ๊ฐ์ฑ๊ณผ ๊ฒ์ ํ๋ ์ด ๋จ์๋ฅผ ํจ๊ป ๋ด๋๋ค."}]
},
{
"role": "user",
"content": [{"type": "text", "text": "talk oracle"}]
},
{
"role": "assistant",
"content": [{"type": "text", "text": "์์ธ์๋ ์จ์ ๊ณ ๋ฅธ ๋ค ๋ฎ๊ฒ ๋งํ๋ค. ์ฒซ ๋ถ์ ๊ธธ์ ๋ฐํ๋ ๊ฒ์ด ์๋๋ผ, ๋์์ฌ ์๋ฆฌ๋ฅผ ๊ธฐ์ตํ๊ฒ ๋ง๋ ๋ค."}]
}
]
}
```
## ์ถ์ฒ ์ ์ ์์
์ ๋ฐ์ดํฐ์
์ ๋ง๋ค ๋๋ ์๋ ์์๋ฅผ ๊ถํ๋ค.
1. ์ญํ ๊ตฐ์ ๋จผ์ ๋๋๋ค
- lore / NPC / quest-system / environment
2. user ์
๋ ฅ๊ตฐ์ ๋จผ์ ์ ํ๋ค
- ๋ช
๋ นํ, ์ค๋ช
ํ, ํํธํ
3. assistant ๊ธธ์ด๋ฅผ ์ ํํ๋ค
- ๋๋ฌด ๊ธธ์ด์ง์ง ์๊ฒ
4. exact duplicate ๋ฅผ ์ ๊ฑฐํ๋ค
5. ChatML ๋ฒ์ ๊ณผ Gemma 4 typed ๋ฒ์ ์ ๋ชจ๋ ๋ง๋ ๋ค
6. ์ค์ ์ถ๋ก ํ
์คํธ๋ฅผ ๋จผ์ ํด๋ณธ๋ค
- `talk oracle`
- `look`
- `scan signal`
- `First Fire Horizon์ด ์ด๋ค ๊ณณ์ธ์ง ์ค๋ช
ํด์ค.`
## ํ์ง ์ ๊ฒ ์ฒดํฌ๋ฆฌ์คํธ
๋ฐ์ดํฐ์
์ ์ถ๊ฐํ๊ฑฐ๋ ์์ ํ ๋๋ ์๋๋ฅผ ๋ณด๋ ๊ฒ์ด ์ข๋ค.
- ํ๊ตญ์ด ํค์ด ์ผ๊ด์ ์ธ๊ฐ
- system ์ญํ ์ด ๋๋ฌด ํ์ชฝ์ผ๋ก ์ ๋ฆฌ์ง ์๋๊ฐ
- user ์
๋ ฅ์ด ์ง๋์น๊ฒ ๊ธธ์ง ์์๊ฐ
- assistant ๋ต๋ณ์ด ์ฅํฉํด์ง์ง ์๋๊ฐ
- ํ์ค ์์ ๊ฐ์๋ก ์๋ ์ํ์ด ์์ด์ง ์์๋๊ฐ
- ๊ฒ์ ์์ง ํ์ ๋ฌธ์ฅ์ด ๋ค์ด๊ฐ ์์ง ์์๊ฐ
- exact duplicate ๊ฐ ๋จ์ ์์ง ์์๊ฐ
- Gemma 4 ํ
ํ๋ฆฟ ๊ฒฝ๋ก์์ `content` ํ์
์ถฉ๋์ด ์๋๊ฐ
## ์ด ์ ์ฅ์์์ ์ค์ ๋ก ์ฐ๋ ์ค๋น ์คํฌ๋ฆฝํธ
starter package ์์๋ ๋ฐ์ดํฐ ์ค๋น ์คํฌ๋ฆฝํธ๋ ํฌํจ๋์ด ์๋ค.
- [`gemma-mud-colab-starter/scripts/prepare_unsloth_gemma4_dataset.py`](./gemma-mud-colab-starter/scripts/prepare_unsloth_gemma4_dataset.py)
์ด ์คํฌ๋ฆฝํธ๋ ๋ฉ์์ง ์ ๋ฆฌ, dedup, Unsloth/Gemma 4์ฉ ํฌ๋งท ์์ฑ ๊ฐ์ ๋ฐ๋ณต ์์
์ ๋ค์ ํ๊ธฐ ์ฝ๊ฒ ๋จ๊ฒจ ๋ ๊ฒ์ด๋ค.
## ์์ผ๋ก ํ์ฅํ๋ ค๋ฉด
์ง๊ธ ๋ฐ์ดํฐ์
์ โ์คํ์ผ๊ณผ ๊ตฌ์กฐ๋ฅผ ์ตํ๋ ์ฒซ ๋ฌถ์โ์ผ๋ก๋ ์ถฉ๋ถํ์ง๋ง, ๋ ๋์ ํ์ง์ ์ํ๋ฉด ์๋ ๋ฐฉํฅ์ด ์ข๋ค.
- NPC๋ณ ์ ์ฉ ๋ฐ์ดํฐ์
๋ถ๋ฆฌ
- ์ง์ญ/๊ฑฐ์ ๋ณ ์ธ๊ณ๊ด ์ฌ์ ํ์ฅ
- quest-system ๋ฉ์์ง ๋ถ๋ฆฌ
- `look` / `rumor` / `scan` ๊ณ์ด์ ๋ ๋ง์ด ํ๋ณด
- ์ฅ๊ธฐ ๋ํํ ๋ฐ์ดํฐ ์ถ๊ฐ
- ์์ง ํ์ฒ๋ฆฌ ๊ท์น๊ณผ ํจ๊ป ํ๊ฐ
## ๋ชจ๋ธ ์นด๋์์ ์ด ๋ฌธ์๋ฅผ ์ ๋ฐ๋ก ๋๋๊ฐ
๋ชจ๋ธ ์นด๋๋ ๋ณดํต ์๋๋ฅผ ๋น ๋ฅด๊ฒ ๋ณด์ฌ ์ค์ผ ํ๋ค.
- ๋ฌด์์ ํ๋ ๋ชจ๋ธ์ธ๊ฐ
- ์ด๋ป๊ฒ ์ฐ๋๊ฐ
- ์ด๋ค ํ์ผ์ด ์๋๊ฐ
๋ฐ๋ฉด ๋ฐ์ดํฐ์
๋ถ์์ ์๋๊ฐ ํ์ํ๋ค.
- ์ ์ ๊ณผ์
- ํฌ๋งท ์ฐจ์ด
- ์ค๋ณต ์ ๊ฑฐ ์ด์
- ์์ฑ ๊ท์น
- ํ์ฅ ๋ฐฉํฅ
๋์ ํ ๋ฌธ์์ ๋ชจ๋ ๋ฐ์ด ๋ฃ์ผ๋ฉด ๋ชจ๋ธ ์นด๋๊ฐ ์ง๋์น๊ฒ ๊ธธ์ด์ง๊ณ , ํต์ฌ ์ฌ์ฉ์๊ฐ ๋นจ๋ฆฌ ์ ๋ณด๋ฅผ ์ฐพ๊ธฐ ์ด๋ ค์์ง๋ค.
๊ทธ๋์ ์ด ์ ์ฅ์๋ **๋ชจ๋ธ ์นด๋์ ๋ฐ์ดํฐ์
๊ฐ์ด๋๋ฅผ ๋ถ๋ฆฌ**ํ๋ ์ชฝ์ด ๋ ์ ํฉํ๋ค.
|