Text Generation
Transformers
Safetensors
Chinese
llama
traditional chinese
zh-tw
zh-hant
taiwan
conversational
text-generation-inference
Instructions to use feabries/TaiwanWordTranslator-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use feabries/TaiwanWordTranslator-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="feabries/TaiwanWordTranslator-v0.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("feabries/TaiwanWordTranslator-v0.1") model = AutoModelForCausalLM.from_pretrained("feabries/TaiwanWordTranslator-v0.1") 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 feabries/TaiwanWordTranslator-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "feabries/TaiwanWordTranslator-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "feabries/TaiwanWordTranslator-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/feabries/TaiwanWordTranslator-v0.1
- SGLang
How to use feabries/TaiwanWordTranslator-v0.1 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 "feabries/TaiwanWordTranslator-v0.1" \ --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": "feabries/TaiwanWordTranslator-v0.1", "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 "feabries/TaiwanWordTranslator-v0.1" \ --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": "feabries/TaiwanWordTranslator-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use feabries/TaiwanWordTranslator-v0.1 with Docker Model Runner:
docker model run hf.co/feabries/TaiwanWordTranslator-v0.1
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,9 +1,37 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
widget:
|
| 5 |
-
- text:
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
# Taiwan Words Translator 繁體中文台灣化翻譯器 by LLMs
|
|
|
|
| 1 |
---
|
| 2 |
+
tags:
|
| 3 |
+
- traditional chinese
|
| 4 |
+
- zh-tw
|
| 5 |
+
- zh-hant
|
| 6 |
+
- taiwan
|
| 7 |
widget:
|
| 8 |
+
- text: |-
|
| 9 |
+
<|system|>
|
| 10 |
+
對於輸入內容的中文文字,請將中國用語轉成台灣的用語,其他非中文文字或非中國用語都維持不變。
|
| 11 |
+
|
| 12 |
+
範例:
|
| 13 |
+
Input: ```這個視頻的質量真高啊```
|
| 14 |
+
Output: ```這個影片的品質真高啊```</s>
|
| 15 |
+
<|user|>
|
| 16 |
+
Input: ```這個軟件的質量真高啊```</s>
|
| 17 |
+
<|assistant|>
|
| 18 |
+
Output:
|
| 19 |
+
- text: |-
|
| 20 |
+
<|system|>
|
| 21 |
+
對於輸入內容的中文文字,請將中國用語轉成台灣的用語,其他非中文文字或非中國用語都維持不變。
|
| 22 |
+
|
| 23 |
+
範例:
|
| 24 |
+
Input: ```這個視頻的質量真高啊```
|
| 25 |
+
Output: ```這個影片的品質真高啊```</s>
|
| 26 |
+
<|user|>
|
| 27 |
+
Input: ```我們建立了數據庫,用來儲存和管理線上服務的信息```</s>
|
| 28 |
+
<|assistant|>
|
| 29 |
+
Output:
|
| 30 |
+
license: agpl-3.0
|
| 31 |
+
datasets:
|
| 32 |
+
- MBZUAI/Bactrian-X
|
| 33 |
+
language:
|
| 34 |
+
- zh
|
| 35 |
---
|
| 36 |
|
| 37 |
# Taiwan Words Translator 繁體中文台灣化翻譯器 by LLMs
|