Instructions to use lianghsun/gemma-3-tw-270m-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lianghsun/gemma-3-tw-270m-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lianghsun/gemma-3-tw-270m-it") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("lianghsun/gemma-3-tw-270m-it") model = AutoModelForMultimodalLM.from_pretrained("lianghsun/gemma-3-tw-270m-it") 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/gemma-3-tw-270m-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lianghsun/gemma-3-tw-270m-it" # 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/gemma-3-tw-270m-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lianghsun/gemma-3-tw-270m-it
- SGLang
How to use lianghsun/gemma-3-tw-270m-it 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/gemma-3-tw-270m-it" \ --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/gemma-3-tw-270m-it", "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/gemma-3-tw-270m-it" \ --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/gemma-3-tw-270m-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lianghsun/gemma-3-tw-270m-it with Docker Model Runner:
docker model run hf.co/lianghsun/gemma-3-tw-270m-it
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/gemma-3-tw-270m-it" \
--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/gemma-3-tw-270m-it",
"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/gemma-3-tw-270m-it" \
--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/gemma-3-tw-270m-it",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'Model Card for gemma-3-tw-270m-it
gemma-3-tw-270m-it ๆฏ้ๅฐไธญ่ฏๆฐๅๅฐ็ฃ่ชๅข่จญ่จ็็น้ซไธญๆ่ผ้็ดๆไปคๅพฎ่ชฟๆจกๅใๆฌๆจกๅๅปบๆงๆผ lianghsun/gemma-3-270m-tw๏ผGemma-3 270M ็็นไธญๆ็บ้ ่จ็ทด็ๆฌ๏ผไนไธ๏ผไธฆไปฅ็นไธญๅฐ่ฉฑ่ณๆๅฎๆๆไปคๅพฎ่ชฟ๏ผ้ฉๅๅจ็ซฏๅดใ้็ทฃ่ฃ็ฝฎ่็่ฆฝๅจๅ ง็ญ่ณๆบๅ้็ๆ ๅขไธๆไพ่ผ้็ด็็นไธญๅฐ่ฉฑ่ฝๅใ
โ ๏ธ ่ฆๆ ผ้้ป๏ผ ๆฌๆจกๅ็บ 270M ๅๆธๅฐๅ่ช่จๆจกๅ๏ผSLM๏ผใ็ดๆๆฌๅฎๆจกๆ ใ
Model Details
็นผ Gemma-3 ็ณปๅๆจกๅๆจๅบๅพ๏ผ270M ็ดๅฅ็ๅฐๆจกๅๅจ็ซฏๅด่ไฝๆๆฌ้จ็ฝฒ็ๆ ๅขไธๆ็จ็นๅชๅข๏ผไฝๅ็็นไธญ่ฝๅ่ๅฐ็ฃๆฌๅฐ่ชๅข็่งฃ็ธ็ถๆ้ใgemma-3-tw-270m-it ๅณ็บ่งฃๆฑบๆญคๅทฎ่ท่่จญ่จ็ๆไปคๅพฎ่ชฟ็ๆฌ๏ผๅ ไปฅ็นไธญ่ชๆๆ็บ้ ่จ็ทด๏ผๅไปฅๅฐ็ฃๅธธ่ฆไปปๅไนๆไปคๅฐ่ฉฑๅฎๆ SFT๏ผไฝฟๅ ถๅจ่ผ้็ด่ฆๆจกไธไปไฟๆๅฏ็จ็็นไธญไบๅ่ฝๅใ
ๆ ธๅฟ็น้ป (Key Features)
- ๅฐๅๅใๅฏ็ซฏๅด้จ็ฝฒ๏ผ270M ๅๆธ๏ผๅฏๅจ็ญ้ป CPUใ้็ทฃ่ฃ็ฝฎๆ็่ฆฝๅจ๏ผๆญ้ transformers.js๏ผONNX ้ๅ็ๆฌ๏ผ้่กใ
- ๅฐ็ฃ่ชๅขๅฐ้ฝ๏ผ่จ็ทด่ณๆไปฅ็น้ซไธญๆ่ๅฐ็ฃๅธธ่ฆไปปๅ็บไธป๏ผ้ฟๅ ไธ่ฌๅฐๆจกๅใๆ็น้ซไธญๆๅปไธๆๅฐ็ฃใ็ๅ้กใ
- ไฝ็บไธๆธธๅพฎ่ชฟ่ตท้ป๏ผๅฏไฝ็บๆดๅฐๅๅฐๆกใ้ ๅๅฐ่ฉฑๆจกๅ๏ผๅฆ keyboard-warrior๏ผ็ๅพฎ่ชฟๅบๅบใ
Model Description
- Developed by: Liang Hsun Huang
- Funded by: APMIC
- Base model: lianghsun/gemma-3-270m-tw
- Model type: Gemma3ForCausalLM (Transformers)
- Language(s) (NLP): Traditional Chinese, English
- License: gemma (Google usage license)
Model Sources
- Repository: lianghsun/gemma-3-tw-270m-it
Citation
@misc{gemma_3_tw_270m_it,
title = {gemma-3-tw-270m-it: A Lightweight Traditional Chinese Instruction-Tuned Model for Taiwan},
author = {Huang, Liang Hsun},
year = {2025},
howpublished = {\url{https://huggingface.co/lianghsun/gemma-3-tw-270m-it}}
}
Acknowledge
- ็นๆญคๆ่ฌ APMIC ็็ฎๅๆฏๆดใ
Model Card Authors
Model Card Contact
- Downloads last month
- 2
# Gated model: Login with a HF token with gated access permission hf auth login