🪨 Marble SLM
Collection
2 items • Updated
How to use lianghsun/Marble-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="lianghsun/Marble-3B-Instruct")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("lianghsun/Marble-3B-Instruct")
model = AutoModelForCausalLM.from_pretrained("lianghsun/Marble-3B-Instruct")
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 lianghsun/Marble-3B-Instruct with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "lianghsun/Marble-3B-Instruct"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "lianghsun/Marble-3B-Instruct",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/lianghsun/Marble-3B-Instruct
How to use lianghsun/Marble-3B-Instruct with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "lianghsun/Marble-3B-Instruct" \
--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": "lianghsun/Marble-3B-Instruct",
"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 "lianghsun/Marble-3B-Instruct" \
--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": "lianghsun/Marble-3B-Instruct",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use lianghsun/Marble-3B-Instruct with Docker Model Runner:
docker model run hf.co/lianghsun/Marble-3B-Instruct
Marble-3B-Instruct 是 Marble-3B(Granite 3.1 3B-A800M MoE 之繁中 CPT 版本)的指令微調版本,以繁中對話資料完成 SFT,提供 MoE 架構下的台灣語境繁中對話能力。
⚠️ 規格重點: 本模型為 3B Mixture-of-Experts(MoE)模型、純文本單模態。
MoE 架構在推論時僅活化部分專家權重,可在保留模型容量的同時降低推論成本。本模型在 Marble-3B 之繁中 CPT 底座上做指令微調,目標是讓 MoE 架構在繁中與台灣語境下提供穩定可用的對話能力。
核心特點 (Key Features)
@misc{marble_3b_instruct,
title = {Marble-3B-Instruct: A Traditional Chinese Instruction-Tuned Granite 3B-A800M MoE Model for Taiwan},
author = {Huang, Liang Hsun},
year = {2025},
howpublished = {\url{https://huggingface.co/lianghsun/Marble-3B-Instruct}}
}
Base model
ibm-granite/granite-3.1-3b-a800m-base