Commit
·
6e60dbf
1
Parent(s):
cd7af62
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: yentinglin/Taiwan-LLM-13B-v2.0-chat
|
| 3 |
+
inference: false
|
| 4 |
+
language:
|
| 5 |
+
- zh
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
model_creator: yentinglin
|
| 9 |
+
model_name: Taiwan-LLM-13B-v2.0
|
| 10 |
+
model_type: llama
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
quantized_by: yentinglin
|
| 13 |
+
tags:
|
| 14 |
+
- finetuned
|
| 15 |
+
---
|
| 16 |
+
# TaiwanLLM 13B v2.0 - AWQ
|
| 17 |
+
- Model creator: [Yenting Lin](https://huggingface.co/yentinglin)
|
| 18 |
+
- Original model: [TaiwanLLM 13B v2.0](https://huggingface.co/yentinglin/Taiwan-LLM-13B-v2.0-chat)
|
| 19 |
+
|
| 20 |
+
<!-- description start -->
|
| 21 |
+
## Description
|
| 22 |
+
|
| 23 |
+
This repo contains AWQ model files for [TaiwanLLM 13B v2.0](https://huggingface.co/yentinglin/Taiwan-LLM-13B-v2.0-chat).
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
### About AWQ
|
| 27 |
+
|
| 28 |
+
AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference with equivalent or better quality compared to the most commonly used GPTQ settings.
|
| 29 |
+
|
| 30 |
+
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
| 31 |
+
|
| 32 |
+
It is supported by:
|
| 33 |
+
|
| 34 |
+
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
| 35 |
+
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
| 36 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
| 37 |
+
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
| 38 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
| 39 |
+
|
| 40 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/5df9c78eda6d0311fd3d541f/CmusIT5OlSXvFrbTJ7l-C.png" alt="Taiwan LLM Logo" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
| 41 |
+
|
| 42 |
+
# 🌟 Checkout [Taiwan-LLM Demo Chat-UI](http://www.twllm.com) 🌟
|
| 43 |
+
|
| 44 |
+
# Model Card for Taiwan LLM 13B v2.0 chat
|
| 45 |
+
|
| 46 |
+
Taiwan LLM is an advanced language model tailored for Traditional Chinese, focusing on the linguistic and cultural contexts of Taiwan.
|
| 47 |
+
Developed from a large base model, it's enriched with diverse Taiwanese textual sources and refined through Supervised Fine-Tuning.
|
| 48 |
+
This model excels in language understanding and generation, aligning closely with Taiwan's cultural nuances.
|
| 49 |
+
It demonstrates improved performance on various benchmarks like TC-Eval, showcasing its contextual comprehension and cultural relevance.
|
| 50 |
+
For detailed insights into Taiwan LLM's development and features, refer to our [technical report](https://github.com/MiuLab/Taiwan-LLaMa/blob/main/twllm_paper.pdf).
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
## Model description
|
| 54 |
+
|
| 55 |
+
- **Model type:** A 13B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
|
| 56 |
+
- **Language(s) (NLP):** Primarily Traditional Chinese (zh-tw)
|
| 57 |
+
- **Finetuned from model:** [yentinglin/Taiwan-LLM-13B-v2.0-base](https://huggingface.co/yentinglin/Taiwan-LLM-13B-v2.0-base)
|
| 58 |
+
|
| 59 |
+
### Model Sources
|
| 60 |
+
|
| 61 |
+
<!-- Provide the basic links for the model. -->
|
| 62 |
+
|
| 63 |
+
- **Repository:** https://github.com/MiuLab/Taiwan-LLaMa
|
| 64 |
+
- **Demo:** https://twllm.com/
|
| 65 |
+
|
| 66 |
+
## Performance
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
|
| 71 |
+
TMMLUS+ score: 24.76727075757576
|
| 72 |
+
|
| 73 |
+
## Intended uses
|
| 74 |
+
|
| 75 |
+
Here's how you can run the model using the `pipeline()` function from 🤗 Transformers:
|
| 76 |
+
|
| 77 |
+
```python
|
| 78 |
+
# pip install transformers>=4.34
|
| 79 |
+
# pip install accelerate
|
| 80 |
+
|
| 81 |
+
import torch
|
| 82 |
+
from transformers import pipeline
|
| 83 |
+
|
| 84 |
+
pipe = pipeline("text-generation", model="yentinglin/Taiwan-LLM-13B-v2.0-chat", torch_dtype=torch.bfloat16, device_map="auto")
|
| 85 |
+
|
| 86 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
| 87 |
+
messages = [
|
| 88 |
+
{
|
| 89 |
+
"role": "system",
|
| 90 |
+
"content": "你是一個人工智慧助理",
|
| 91 |
+
},
|
| 92 |
+
{"role": "user", "content": "東北季風如何影響台灣氣候?"},
|
| 93 |
+
]
|
| 94 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 95 |
+
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 96 |
+
print(outputs[0]["generated_text"])
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
### Training hyperparameters
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
|
| 108 |
+
The following hyperparameters were used during training:
|
| 109 |
+
- learning_rate: 5e-05
|
| 110 |
+
- distributed_type: multi-GPU
|
| 111 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 112 |
+
- lr_scheduler_type: cosine
|
| 113 |
+
- lr_scheduler_warmup_ratio: 0.03
|
| 114 |
+
- num_epochs: 5.0
|
| 115 |
+
|
| 116 |
+
## Citation
|
| 117 |
+
|
| 118 |
+
If you find Taiwan LLM is useful in your work, please cite it with:
|
| 119 |
+
|
| 120 |
+
```
|
| 121 |
+
@misc{lin2023taiwan,
|
| 122 |
+
title={Taiwan LLM: Bridging the Linguistic Divide with a Culturally Aligned Language Model},
|
| 123 |
+
author={Yen-Ting Lin and Yun-Nung Chen},
|
| 124 |
+
year={2023},
|
| 125 |
+
eprint={2311.17487},
|
| 126 |
+
archivePrefix={arXiv},
|
| 127 |
+
primaryClass={cs.CL}
|
| 128 |
+
}
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
# Acknowledgement
|
| 132 |
+
|
| 133 |
+
Taiwan LLM v2 is conducted in collaboration with [Ubitus K.K.](http://ubitus.net). Ubitus provides valuable compute resources for the project.
|