Instructions to use IRedDragonICY/LaguQA-MiniCPM5-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IRedDragonICY/LaguQA-MiniCPM5-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IRedDragonICY/LaguQA-MiniCPM5-2B") 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("IRedDragonICY/LaguQA-MiniCPM5-2B") model = AutoModelForCausalLM.from_pretrained("IRedDragonICY/LaguQA-MiniCPM5-2B", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IRedDragonICY/LaguQA-MiniCPM5-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IRedDragonICY/LaguQA-MiniCPM5-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IRedDragonICY/LaguQA-MiniCPM5-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/IRedDragonICY/LaguQA-MiniCPM5-2B
- SGLang
How to use IRedDragonICY/LaguQA-MiniCPM5-2B 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 "IRedDragonICY/LaguQA-MiniCPM5-2B" \ --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": "IRedDragonICY/LaguQA-MiniCPM5-2B", "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 "IRedDragonICY/LaguQA-MiniCPM5-2B" \ --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": "IRedDragonICY/LaguQA-MiniCPM5-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use IRedDragonICY/LaguQA-MiniCPM5-2B with Docker Model Runner:
docker model run hf.co/IRedDragonICY/LaguQA-MiniCPM5-2B
LaguQA-MiniCPM5-2B
openbmb/MiniCPM5-2B with the
LaguQA-MiniCPM5-2B-LoRA
adapter merged into its weights, so it loads with plain transformers, vLLM, or
any tool that does not read PEFT adapters. Training, results, and limitations are
documented on the adapter's card; this card covers what is specific to the
merged copy.
| Adapter only | IRedDragonICY/LaguQA-MiniCPM5-2B-LoRA |
| Demo | IRedDragonICY/LaguQA-Demo |
| Dataset | IRedDragonICY/LaguQA |
| Code | github.com/IRedDragonICY/LaguQA |
| Collection | IRedDragonICY/laguqa |
How it was merged
PeftModel.merge_and_unload() on CPU in bfloat16 (torch 2.13.0, transformers
5.16.1, peft 0.20.0). The parameter count is unchanged at 2,516,756,480. The
sha256 of the merged adapter and the base revision are recorded in
asal-gabungan.json.
Merging in bfloat16 rounds each weight once more, so the merged model is not bit-identical to base plus adapter. On the 1,200 LaguQA multiple-choice questions it picks the same option on 1,187 (98.9%); the rest are near ties. It answers 445 correctly against 443 for base plus adapter, both scored with the template default.
Usage
Build prompts with enable_thinking=False, the format the adapter was trained
on (see the adapter card for why this matters).
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "IRedDragonICY/LaguQA-MiniCPM5-2B"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16")
pesan = [{"role": "system", "content":
"Kamu asisten yang menguasai lagu nasional dan lagu daerah "
"Indonesia, termasuk notasi angka dan notasi ABC-nya."},
{"role": "user", "content": "Siapa pencipta lagu Gugur Bunga?"}]
teks = tok.apply_chat_template(pesan, tokenize=False, add_generation_prompt=True,
enable_thinking=False)
keluar = model.generate(**tok(teks, return_tensors="pt").to(model.device),
max_new_tokens=192, do_sample=False)
print(tok.decode(keluar[0], skip_special_tokens=True))
Results in short
LaguQA multiple choice, one seed: 24.3 before training and 51.0 after with
enable_thinking=False (24.2 and 36.9 with the template default). IndoMMLU
falls from 33.6 to 27.2 with enable_thinking=False, so general Indonesian
ability is weaker than in the base model.
Licence
Apache-2.0, the licence of openbmb/MiniCPM5-2B. Training data: CC BY-NC 4.0;
per-song rights are listed in HAK-CIPTA.md in the dataset repository.
- Downloads last month
- 236