Text Generation
Transformers
Safetensors
llama
Taiwan
ROC
zh-tw
instruct
chat
llama3.2
SLM
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use lianghsun/Llama-3.2-Taiwan-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lianghsun/Llama-3.2-Taiwan-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lianghsun/Llama-3.2-Taiwan-3B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lianghsun/Llama-3.2-Taiwan-3B-Instruct") model = AutoModelForCausalLM.from_pretrained("lianghsun/Llama-3.2-Taiwan-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/Llama-3.2-Taiwan-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lianghsun/Llama-3.2-Taiwan-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/Llama-3.2-Taiwan-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lianghsun/Llama-3.2-Taiwan-3B-Instruct
- SGLang
How to use lianghsun/Llama-3.2-Taiwan-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/Llama-3.2-Taiwan-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/Llama-3.2-Taiwan-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/Llama-3.2-Taiwan-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/Llama-3.2-Taiwan-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lianghsun/Llama-3.2-Taiwan-3B-Instruct with Docker Model Runner:
docker model run hf.co/lianghsun/Llama-3.2-Taiwan-3B-Instruct
revert: restore previous Llama-3.2-Taiwan-3B-Instruct model card
Browse files
README.md
CHANGED
|
@@ -981,13 +981,15 @@ metrics:
|
|
| 981 |
- accuracy
|
| 982 |
---
|
| 983 |
|
| 984 |
-
# Model Card for Llama-3.2-Taiwan-3B-Instruct
|
| 985 |
|
| 986 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 987 |
-
|
| 988 |
|
| 989 |
-
|
| 990 |
-
|
|
|
|
|
|
|
| 991 |
|
| 992 |
<details>
|
| 993 |
<summary><b>Model Change Log</b></summary>
|
|
|
|
| 981 |
- accuracy
|
| 982 |
---
|
| 983 |
|
| 984 |
+
# Model Card for lianghsun/Llama-3.2-Taiwan-3B-Instruct
|
| 985 |
|
| 986 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 987 |
+
<a href="https://discord.gg/fj6WbHMvfs" target="_blank">[👋 歡迎加入 Discord 討論 🎉]</a>
|
| 988 |
|
| 989 |
+

|
| 990 |
+
*圖像生成來自 [OpenArt](https://openart.ai/home):An anime-style 🦙 standing proudly atop the summit of Taiwan’s [Yushan (Jade Mountain)](https://zh.wikipedia.org/wiki/%E7%8E%89%E5%B1%B1), gazing forward.*
|
| 991 |
+
|
| 992 |
+
採用 [lianghsun/Llama-3.2-Taiwan-3B](https://huggingface.co/lianghsun/Llama-3.2-Taiwan-3B) 為[基礎模型(foundation model)](https://en.wikipedia.org/wiki/Foundation_model),使用大量[中華民國台灣](https://zh.wikipedia.org/zh-tw/%E8%87%BA%E7%81%A3)的繁體中文對話集和多國語言對話集進行模型[指令微調(instruction fine-tuning)](https://www.ibm.com/topics/instruction-tuning)和多輪迭代[直接偏好優化(direct preference optimization, DPO)](https://arxiv.org/abs/2305.18290),旨在訓練出具有中華民國台灣知識及風格的[小語言模型(small langugae model, SLM)](https://www.ibm.com/think/topics/small-language-models)之對話模型。
|
| 993 |
|
| 994 |
<details>
|
| 995 |
<summary><b>Model Change Log</b></summary>
|