Text Generation
Transformers
Safetensors
Korean
llama
korean
causal-lm
instruction-tuned
from-scratch
kawk
conversational
text-generation-inference
Instructions to use Infinity08/KAWK-500M-Korean-Instruct-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Infinity08/KAWK-500M-Korean-Instruct-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Infinity08/KAWK-500M-Korean-Instruct-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Infinity08/KAWK-500M-Korean-Instruct-v1") model = AutoModelForCausalLM.from_pretrained("Infinity08/KAWK-500M-Korean-Instruct-v1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Infinity08/KAWK-500M-Korean-Instruct-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Infinity08/KAWK-500M-Korean-Instruct-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinity08/KAWK-500M-Korean-Instruct-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Infinity08/KAWK-500M-Korean-Instruct-v1
- SGLang
How to use Infinity08/KAWK-500M-Korean-Instruct-v1 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-500M-Korean-Instruct-v1" \ --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": "Infinity08/KAWK-500M-Korean-Instruct-v1", "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 "Infinity08/KAWK-500M-Korean-Instruct-v1" \ --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": "Infinity08/KAWK-500M-Korean-Instruct-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Infinity08/KAWK-500M-Korean-Instruct-v1 with Docker Model Runner:
docker model run hf.co/Infinity08/KAWK-500M-Korean-Instruct-v1
metadata
language:
- ko
library_name: transformers
pipeline_tag: text-generation
datasets:
- Infinity08/KAWK500M-Korean-SFT-v1
tags:
- llama
- korean
- causal-lm
- instruction-tuned
- kawk
KAWK 500M Korean Instruct v1
한국어 중심 말뭉치로 처음부터 사전학습한 505M 파라미터 KAWK 베이스 모델에 한국어 대화·지시 데이터로 supervised fine-tuning(SFT)을 적용한 모델입니다.
모델 구조
- 아키텍처: Llama 계열 decoder-only Transformer
- 파라미터: 505,350,400
- 어휘: 한국어 SentencePiece Unigram 32,000
- 레이어 / hidden / MLP: 26 / 1,280 / 3,584
- Attention / KV heads: 20 / 5 (GQA)
- 최대 문맥: 2,048토큰
- 입력·출력 임베딩 공유
학습
- 베이스 사전학습량: 한국어 중심 약 100억 토큰
- SFT 데이터:
Infinity08/KAWK500M-Korean-SFT-v1 - 데이터 revision:
0a8e914359a063b916cfd9a3ee068a38ddcc1f79 - SFT: 2 epochs, 739 optimizer steps, 약 9,080만 packed-token capacity
- Assistant 응답 토큰에만 loss 적용
- 유효 배치: 60 sequences × 2,048 tokens
- Precision / GPU: BF16 / NVIDIA A100 80GB
- Learning rate: 2e-5 → 2e-6 cosine decay
- step 700 validation loss / perplexity: 1.9786 / 7.2327
- 전체 설정과 로그:
training/
사용 예시
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Infinity08/KAWK-500M-Korean-Instruct-v1"
tokenizer = AutoTokenizer.from_pretrained(repo_id, use_fast=False)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [{"role": "user", "content": "대한민국의 수도를 간단히 설명해줘."}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=128,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.05,
)
new_tokens = outputs[0, inputs["input_ids"].shape[1]:]
print(tokenizer.decode(new_tokens, skip_special_tokens=True))
대화 템플릿은 ### 지침:, ### 사용자:, ### 도우미: 역할 헤더를 사용하며
토크나이저의 chat_template.jinja에 포함되어 있습니다.
평가
KoBEST·KMMLU 0-shot 평가는 진행 중이며 완료 후 원시 결과와 요약을 evaluation/에 추가합니다.
한계
500M급 모델이므로 복잡한 추론, 정확한 사실 회상, 긴 지시 수행을 보장하지 않습니다. SFT 데이터의 편향이나 잘못된 답을 재현할 수 있으며, 사실성·안전성·개인정보 재현에 대한 포괄적 평가가 완료되지 않았습니다. 고위험 의사결정에 사용하지 마십시오.