LorthGyu/indonesian-slang-lexicon
Viewer • Updated • 1.04k • 70
How to use neosantara/wader-100m with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="neosantara/wader-100m", 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", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("neosantara/wader-100m", 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 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "neosantara/wader-100m"
# 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",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/neosantara/wader-100m
How to use neosantara/wader-100m with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "neosantara/wader-100m" \
--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",
"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" \
--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",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use neosantara/wader-100m with Docker Model Runner:
docker model run hf.co/neosantara/wader-100m
Wader-100M is a lightweight (~110M parameter) conversational Indonesian language model implementing the DeepSeek-V4 architecture (MLA, MoE, Hyper-Connections). It is trained from scratch on Indonesian corpus and instruction-tuned (SFT) to act as a responsive and natural chat assistant.
For the pre-trained base model, see neosantara/wader-100m-base.
This model implements key DeepSeek-V4 innovations at a miniature scale for extreme edge efficiency:
eli5_id (70%) and twitter_indonesia_sarcastic (30%).intisari-indonesian-chat-v4 (50,000 multi-turn dialogs) + Indonesian slang/formalization lexicons.<|begin▁of▁sentence|>, <|User|>, <|Assistant|>, <|end▁of▁sentence|>).import torch
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
repo_id = "neosantara/wader-100m"
# Load config and model
config = AutoConfig.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_config(config, trust_remote_code=True).float()
# 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()
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
# Generate conversational response
messages = [
{"role": "user", "content": "Bro, ada rekomendasi tempat nongkrong asik ga di Jakarta?"}
]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
input_ids = tokenizer.encode(input_text, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(
input_ids,
max_new_tokens=100,
temperature=0.7,
top_p=0.9,
pad_token_id=tokenizer.eos_token_id,
)
# Slice the generated tokens (exclude input prompt)
generated_tokens = output[0][input_ids.shape[1]:]
print(tokenizer.decode(generated_tokens, skip_special_tokens=True))
trust_remote_code=True to run correctly.Apache-2.0
Base model
neosantara/wader-100m-base