HuggingFace镜像/Taiwan-LLM-7B-v2.1-chat
模型介绍文件和版本分析
下载使用量0

🌟 欢迎体验 Taiwan-LLM Demo Chat-UI 🌟

Taiwan LLM 7B v2.1 chat 模型卡片

Taiwan LLM 是一款专为繁体中文打造的先进语言模型,专注于台湾的语言和文化语境。 该模型基于大型基础模型开发,通过多样化的台湾文本资源进行充实,并经过有监督微调优化。 此模型在语言理解和生成方面表现卓越,能紧密贴合台湾的文化细微差异。 它在 TC-Eval 等各类基准测试中展现出更优性能,彰显了其在语境理解和文化相关性方面的优势。 如需深入了解 Taiwan LLM 的开发过程和特性,请参阅我们的 技术报告。

模型描述

  • 模型类型: 一个拥有 70 亿参数的类 GPT 模型,在公开可用的合成数据集混合体上进行了微调。
  • 语言(自然语言处理): 主要为繁体中文(zh-tw)
  • 微调基础模型: [yentinglin/Taiwan-LLM-7B-v2.0-base]
  • TMMLUS+ 分数: 22.19570181818182

模型来源

  • 代码库: https://github.com/MiuLab/Taiwan-LLaMa
  • 演示: https://twllm.com/

性能

预期用途

以下是如何使用 🤗 Transformers 中的 pipeline() 函数运行模型的方法:

# pip install transformers>=4.34
# pip install accelerate

import torch
from openmind import pipeline

pipe = pipeline("text-generation", model="LF_AICC/Taiwan-LLM-7B-v2.1-chat", torch_dtype=torch.bfloat16, device_map="auto")

# We use the tokenizer's chat template to format each message
messages = [
    {
        "role": "system",
        "content": "你是一個人工智慧助理",
    },
    {"role": "user", "content": "東北季風如何影響台灣氣候?"},
]
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])

训练超参数

训练过程中使用了以下超参数:

  • learning_rate: 5e-05
  • distributed_type: 多GPU
  • optimizer: Adam,betas=(0.9,0.999),epsilon=1e-08
  • lr_scheduler_type: cosine
  • lr_scheduler_warmup_ratio: 0.03
  • num_epochs: 5.0

引用

如果您发现Taiwan LLM对您的工作有帮助,请按以下方式引用:

@misc{lin2023taiwan,
      title={Taiwan LLM: Bridging the Linguistic Divide with a Culturally Aligned Language Model}, 
      author={Yen-Ting Lin and Yun-Nung Chen},
      year={2023},
      eprint={2311.17487},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

致谢

Taiwan LLM v2 是与 Ubitus K.K. 合作开展的项目。Ubitus 为该项目提供了宝贵的计算资源。