Instructions to use Infinity08/KAWK-1.5-500M-Korean-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Infinity08/KAWK-1.5-500M-Korean-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Infinity08/KAWK-1.5-500M-Korean-Base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Infinity08/KAWK-1.5-500M-Korean-Base") model = AutoModelForCausalLM.from_pretrained("Infinity08/KAWK-1.5-500M-Korean-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Infinity08/KAWK-1.5-500M-Korean-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Infinity08/KAWK-1.5-500M-Korean-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinity08/KAWK-1.5-500M-Korean-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Infinity08/KAWK-1.5-500M-Korean-Base
- SGLang
How to use Infinity08/KAWK-1.5-500M-Korean-Base 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 "Infinity08/KAWK-1.5-500M-Korean-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinity08/KAWK-1.5-500M-Korean-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Infinity08/KAWK-1.5-500M-Korean-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinity08/KAWK-1.5-500M-Korean-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Infinity08/KAWK-1.5-500M-Korean-Base with Docker Model Runner:
docker model run hf.co/Infinity08/KAWK-1.5-500M-Korean-Base
KAWK-1.5-500M Korean Base
ํ๊ตญ์ด์ ํ์ต ์์ฐ์ ์ง์คํ ์ํ ์ธ์ด๋ชจ๋ธ์ ๊ฐ๋ฅ์ฑ์ ๊ฒ์ฆํ๊ธฐ ์ํด ํ๊ตญ์ด tokenizer์ 505M ํ๋ผ๋ฏธํฐ Llama ๊ณ์ด ๋ชจ๋ธ์ ์ฒ์๋ถํฐ ํ์ตํ ๋ฒ ์ด์ค ์ธ์ด๋ชจ๋ธ์ ๋๋ค.
KAWK-50M์์ tokenizer, ๋ฐ์ดํฐ ์ ์ , causal objective, checkpoint ๋ณต๊ตฌ, long-context CPT์ ๊ณต๊ฐ ํ๊ฐ pipeline์ ๋จผ์ ๊ฒ์ฆํ ๋ค ๊ท๋ชจ๋ฅผ 500M์ผ๋ก ํ์ฅํ์ต๋๋ค. ๊ธฐ์กด ๋ค๊ตญ์ด ๋ชจ๋ธ์ ํ๊ตญ์ด๋ก ๊ณ์ ํ์ตํ ๋ชจ๋ธ์ด ์๋๋ฉฐ, ํ๊ตญ์ด ์ค์ฌ ์ฝ 10B tokens๋ก scratch pretrainingํ์ต๋๋ค.
์ด ๋ชจ๋ธ์ ์ง์ ํ๋ ์ ์ next-token predictor์ ๋๋ค. ์ง๋ฌธยท๋ํ์๋ KAWK 500M Instruct๊ฐ ๋ ์ ํฉํฉ๋๋ค.
์ ๋ง๋ค์๋
- ํ๊ตญ์ด ์ ์ฉ tokenizer์ ๋ฐ์ดํฐ๊ฐ ์์ parameter budget์ ํจ์จ์ ๋์ผ ์ ์๋์ง ํ์ธ
- ๊ฐ์ธ ํ๋ก์ ํธ์์๋ ๋ฐ์ดํฐ ์ค๋น๋ถํฐ pretraining, SFT, benchmark๊น์ง ์ฌํ ๊ฐ๋ฅํ์ง ๊ฒ์ฆ
- ์๋น์ GPU์์ ์คํ ๊ฐ๋ฅํ ํ๊ตญ์ด foundation model ํ๋ณด
- ์ต์ข checkpoint๋ฟ ์๋๋ผ dataset revision, ์ค์ ๊ณผ ๋ก๊ทธ๊น์ง ๊ณต๊ฐ
๋ชจ๋ธ ๊ตฌ์กฐ
| ํญ๋ชฉ | ๊ฐ |
|---|---|
| ์ํคํ ์ฒ | LlamaForCausalLM, decoder-only |
| ํ๋ผ๋ฏธํฐ | 505,350,400 |
| ์ดํ | ํ๊ตญ์ด SentencePiece Unigram 32,000 |
| ๋ ์ด์ด | 26 |
| Hidden / MLP | 1,280 / 3,584 |
| Attention / KV heads | 20 / 5 (GQA) |
| Head dimension | 64 |
| ์ต๋ ๋ฌธ๋งฅ | 2,048 tokens |
| ํ์ฑํ / ์ ๊ทํ | SwiGLU(SiLU) / RMSNorm |
| ์ ๋ ฅยท์ถ๋ ฅ ์๋ฒ ๋ฉ | ๊ณต์ |
ํ์ต
- Dataset:
Infinity08/KAWK500M-Korean-Pretraining-10B - Dataset revision:
a08539316e6dcf1d194c6d1684a43e3526e11a63๋ก ๊ณ ์ - ์ ํจ ํ์ต๋: 10,000,097,280 tokens
- Sequence length: 2,048
- Optimizer steps: 81,381
- Precision / GPU: BF16 / NVIDIA H100 SXM 80GB
- ํ๊ท ์ฒ๋ฆฌ๋: ์ฝ 60.35K tokens/s
- ์ต์ข train loss: 2.5441
- ์ต์ข validation loss / perplexity: 2.52412 / 12.48
ํ๊ตญ์ด ๋ฌธ์์ ํฌํจ๋ ์๋ฌธ ์ด๋ฆ, ์ซ์, ๋จ์์ ๊ธฐํธ๋ ์ ์งํ์ง๋ง ์์ดยท์ฝ๋ยท์ํ ์ ์ฉ dataset์ ๋ณ๋ ํ์ต source๋ก ์ฌ์ฉํ์ง ์์์ต๋๋ค. ์์ฒ revision๊ณผ ํ์ต manifest๋ dataset ๋ฐ training archive์ ๋ณด์กดํ์ต๋๋ค.
์ฌ์ฉ ์์
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Infinity08/KAWK-1.5-500M-Korean-Base"
tokenizer = AutoTokenizer.from_pretrained(repo_id, use_fast=False)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
inputs = tokenizer("๋ํ๋ฏผ๊ตญ์ ์๋๋", return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=80,
do_sample=True,
temperature=0.8,
top_p=0.9,
repetition_penalty=1.1,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
ํ๊ณ
- Base ๋ชจ๋ธ์ด๋ฏ๋ก ๋ํํ ์ง์ ์ํ์ ๊ธฐ๋ํ๋ฉด ์ ๋ฉ๋๋ค.
- 500M๊ธ์ ์ง์๋๊ณผ ์ถ๋ก ๋ฅ๋ ฅ์๋ ๋๋ ทํ ํ๊ณ๊ฐ ์์ต๋๋ค.
- ์๋ชป๋ ์ฌ์ค, ๋ฐ๋ณต, ์น ๋ฐ์ดํฐ์ ํธํฅ์ ์์ฑํ ์ ์์ต๋๋ค.
- ๋ค๋ฅธ tokenizer๋ฅผ ์ฐ๋ ๋ชจ๋ธ๊ณผ token-level perplexity๋ฅผ ์ง์ ๋น๊ตํ๋ฉด ์ ๋ฉ๋๋ค.
- ํฌ๊ด์ ์ธ ์์ ์ฑยท๊ฐ์ธ์ ๋ณด ์ฌํ ํ๊ฐ๊ฐ ์๋ฃ๋์ง ์์์ต๋๋ค.
- ๊ณ ์ํ ์์ฌ๊ฒฐ์ ์ ์ฌ์ฉํ์ง ๋ง์ญ์์ค.
๊ด๋ จ ์๋ฃ
- Downloads last month
- 260