w11wo/twitter_indonesia_sarcastic
Viewer • Updated • 2.68k • 172 • 10
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) # 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=40)
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
A lightweight ~110M parameter Indonesian language model implementing the DeepSeek-V4 architecture (MLA, MoE, Hyper-Connections) trained from scratch on Indonesian corpus. This is the pretrained base model — see neosantara/wader-100m for the SFT/chat version.
This model implements key DeepSeek-V4 innovations at a miniature scale:
| Component | Details |
|---|---|
| Parameters | ~110M total (41M embeddings, 69M non-embedding) |
| Hidden size | 320 |
| Layers | 8 |
| Attention heads | 8 (1 KV head — MQA-style) |
| 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 | 129,280 (DeepSeek-V4 tokenizer) |
| Context | 2,048 tokens |
| Metric | Value |
|---|---|
| Initial Loss | ~10.8 |
| Final Loss | ~0.41 - 0.58 (cross-entropy) |
| Token Accuracy | ~88% - 93% |
import torch
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
# 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).float()
# 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 = model.cuda().eval() if torch.cuda.is_available() else 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")
if torch.cuda.is_available():
input_ids = input_ids.cuda()
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.Apache-2.0