Text Generation
Transformers
Safetensors
Chinese
English
granitemoe
Taiwan
ROC
zhtw
Marble
Granite
MoE
chat
instruct
conversational
Instructions to use lianghsun/Marble-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
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", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lianghsun/Marble-3B-Instruct with vLLM:
Install from pip and serve model
# 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?" } ] }'Use Docker
docker model run hf.co/lianghsun/Marble-3B-Instruct
- SGLang
How to use lianghsun/Marble-3B-Instruct 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 "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?" } ] }'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 "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 Model Runner
How to use lianghsun/Marble-3B-Instruct with Docker Model Runner:
docker model run hf.co/lianghsun/Marble-3B-Instruct
|
Download README.md from lianghsun/Marble-3B-Instruct: direct link, hf CLI and curl.
- Browser
- Download file 2.45 kB
-
https://huggingface.co/lianghsun/Marble-3B-Instruct/resolve/main/README.md
- Command line
-
hf download hf://lianghsun/Marble-3B-Instruct/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/lianghsun/Marble-3B-Instruct/resolve/main/README.md
2.45 kB
metadata
license: apache-2.0
language:
- zh
- en
base_model:
- lianghsun/Marble-3B
library_name: transformers
pipeline_tag: text-generation
tags:
- Taiwan
- ROC
- zhtw
- Marble
- Granite
- MoE
- chat
- instruct
Model Card for Marble-3B-Instruct
Marble-3B-Instruct 是 Marble-3B(Granite 3.1 3B-A800M MoE 之繁中 CPT 版本)的指令微調版本,以繁中對話資料完成 SFT,提供 MoE 架構下的台灣語境繁中對話能力。
⚠️ 規格重點: 本模型為 3B Mixture-of-Experts(MoE)模型、純文本單模態。
Model Details
MoE 架構在推論時僅活化部分專家權重,可在保留模型容量的同時降低推論成本。本模型在 Marble-3B 之繁中 CPT 底座上做指令微調,目標是讓 MoE 架構在繁中與台灣語境下提供穩定可用的對話能力。
核心特點 (Key Features)
- MoE 架構對話模型:推論成本相對於同容量稠密模型更低。
- 台灣語境對齊:訓練資料以繁中與台灣常見任務為主。
- 可端側部署:3B 規模友善於消費級硬體。
Model Description
- Developed by: Liang Hsun Huang
- Funded by: APMIC
- Base model: lianghsun/Marble-3B
- Model type: GraniteMoeForCausalLM (Transformers)
- Language(s) (NLP): Traditional Chinese, English
- License: Apache-2.0
- Finetuned from model: lianghsun/Marble-3B
Model Sources
- Repository: lianghsun/Marble-3B-Instruct
Citation
@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}}
}
Acknowledge
- 特此感謝 APMIC 的算力支援。