neosantara/IndoTalk
Viewer • Updated • 396k • 38
How to use neosantara/wader-100m-base with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="neosantara/wader-100m-base", trust_remote_code=True)
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("neosantara/wader-100m-base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("neosantara/wader-100m-base", trust_remote_code=True, 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=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use neosantara/wader-100m-base with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "neosantara/wader-100m-base"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "neosantara/wader-100m-base",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/neosantara/wader-100m-base
How to use neosantara/wader-100m-base with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "neosantara/wader-100m-base" \
--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": "neosantara/wader-100m-base",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "neosantara/wader-100m-base" \
--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": "neosantara/wader-100m-base",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use neosantara/wader-100m-base with Docker Model Runner:
docker model run hf.co/neosantara/wader-100m-base
[English Version: README.en.md]
Model bahasa Indonesia ringan berukuran ~110 Juta parameter yang mengimplementasikan arsitektur DeepSeek-V4 (MLA, MoE, Hyper-Connections), dilatih dari nol menggunakan korpus percakapan bahasa Indonesia berskala besar. Ini adalah model dasar (pretrained base model) — untuk versi Chat/SFT, silakan gunakan neosantara/wader-100m.
Model ini mengimplementasikan inovasi kunci DeepSeek-V4 pada skala miniatur:
| Komponen | Detail |
|---|---|
| Parameter | ~110M total (41M embedding, 69M non-embedding) |
| Hidden size | 320 |
| Layer | 8 |
| Attention heads | 8 (1 KV head — gaya MQA) |
| Head dim | 96 (32 RoPE + 64 NoPE) |
| MLA | q_lora_rank=160, o_groups=2, o_lora_rank=80 |
| MoE | 4 routed experts + 1 shared, top-2 routing |
| Expert FFN | SwiGLU, intermediate_size=640 |
| Routing | sqrtsoftplus scoring, noaux_tc method |
| Hyper-Connections | hc_mult=4, Sinkhorn routing (2 iters) |
| Vocab | 128.000 (Tokenizer DeepSeek-V4) |
| Konteks | 2.048 token |
| Metrik | Nilai |
|---|---|
| Final Train Loss | ~2.83 (Cross-Entropy pada Step 5000) |
| Token Accuracy | ~49.38% (Prediksi kata berikutnya dari awal) |
import torch
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
# PENTING: Model ini mewajibkan penggunaan GPU modern (Ampere/Ada/Hopper) yang mendukung bfloat16.
# Jika dijalankan di CPU atau GPU tua (seperti T4), akan terjadi error NaN.
device = "cuda" if torch.cuda.is_available() else "cpu"
# 1. Load config and model
repo_id = "neosantara/wader-100m-base"
config = AutoConfig.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_config(config, trust_remote_code=True).to(torch.bfloat16).to(device)
# 2. Download and load weights
weights_path = hf_hub_download(repo_id, "model.safetensors")
state_dict = load_file(weights_path)
model.load_state_dict(state_dict, strict=True)
model.eval()
# 3. Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
# 4. Generate Indonesian text completion
prompt = "Indonesia adalah negara kepulauan yang memiliki"
input_ids = tokenizer.encode(prompt, return_tensors="pt").to(device)
with torch.no_grad():
output = model.generate(
input_ids,
max_new_tokens=100,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
trust_remote_code=True.bfloat16. Berjalan di CPU murni (float32) atau GPU lama (T4) akan meluapkan limit kalkulasi (overflow) yang menyebabkan NaN error.Apache-2.0