How to use from
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 "idah4/byteetm-korean-tiny" \
    --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": "idah4/byteetm-korean-tiny",
		"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 "idah4/byteetm-korean-tiny" \
        --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": "idah4/byteetm-korean-tiny",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

ByteETM-Korean

소형 바이트-레벨 텍스트 디코더 LM

  • 133 MB byte-level causal LM trained on Korean web text.
  • 학습 데이터: roneneldan/TinyStories, HAERAE-HUB/KOREAN-WEBTEXT 일부
  • HAERAE-HUB/KOREAN-WEBTEXT 데이터셋 최종 val ppl ≈ 3.4

Example

# %% ByteETM Inference (바이트 기반 추론)
import torch
from transformers import AutoModelForCausalLM

# 1️⃣ 모델 로드
repo_id = "idah4/byteetm-korean-tiny"
device = "cuda" if torch.cuda.is_available() else "cpu"

model = AutoModelForCausalLM.from_pretrained(
    repo_id,
    trust_remote_code=True
).to(device).eval()

# 2️⃣ 바이트 기반 인코더 / 디코더
def encode_bytes(text: str):
    return torch.tensor([[b for b in text.encode("utf-8")]], dtype=torch.long, device=device)

def decode_bytes(ids: torch.Tensor):
    seq = [i for i in ids.tolist() if 0 <= i < 256]
    return bytes(seq).decode("utf-8", errors="ignore")

# 3️⃣ 텍스트 생성 함수
@torch.no_grad()
def generate_text(prompt: str, max_new_tokens=200, temperature=0.8, top_k=200):
    input_ids = encode_bytes(prompt)
    out = model.generate(
        input_ids,
        max_new_tokens=max_new_tokens,
        temperature=temperature,
        top_k=top_k
    )
    return decode_bytes(out[0])

# 4️⃣ 시연
prompt = "오늘은 날씨가 좋아서"
print(generate_text(prompt, max_new_tokens=150, temperature=0.9, top_k=150))
Downloads last month
148
Safetensors
Model size
19.5M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train idah4/byteetm-korean-tiny