🚀 StarChat Alpha模型卡片
StarChat是一系列基于StarCoder微调的语言模型,旨在成为实用的编码助手。StarChat Alpha是该系列的首个模型,作为Alpha版本,仅用于教育或研究目的。该模型尚未使用如基于人类反馈的强化学习(RLHF)等技术与人类偏好对齐,因此可能会生成有问题的内容(尤其是在被明确要求时)。
🚀 快速开始
使用以下代码开始使用该模型。
你可以使用🤗 Transformers库中的pipeline()
函数来运行该模型:
import torch
from transformers import pipeline
pipe = pipeline("text-generation", model="HuggingFaceH4/starchat-alpha", torch_dtype=torch.bfloat16, device_map="auto")
prompt_template = "<|system|>\n<|end|>\n<|user|>\n{query}<|end|>\n<|assistant|>"
prompt = prompt_template.format(query="How do I sort a list in Python?")
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.2, top_k=50, top_p=0.95, eos_token_id=49155)
✨ 主要特性
📚 详细文档
模型来源
- 仓库:https://github.com/bigcode-project/starcoder
- 演示:https://huggingface.co/spaces/HuggingFaceH4/starchat-playground
使用场景
StarChat Alpha旨在用于教育和/或研究目的,可用于探索开源语言模型的编程能力。
偏差、风险和局限性
StarChat Alpha尚未使用如RLHF等技术与人类偏好对齐,也没有像ChatGPT那样在运行时对回复进行过滤,因此该模型可能会产生有问题的输出(尤其是在被明确要求时)。
主要基于代码数据训练的模型也会存在与GitHub社区人口统计特征相关的更明显的人口统计学偏差,更多信息请参阅源自The Stack的StarCoder数据集。
由于基础模型是在大量代码语料库上进行预训练的,它可能会生成语法正确但语义错误的代码片段。例如,它可能会生成无法编译或产生错误结果的代码,也可能会生成存在安全漏洞的代码。此外,我们还观察到该模型有生成虚假URL的倾向,点击前应仔细检查。
StarChat Alpha是基于基础模型StarCoder Base进行微调的,请参考其模型卡片的局限性部分获取相关信息。特别是,该模型在一些性别偏差类别、毒性倾向以及建议存在已知安全漏洞的代码补全风险方面进行了评估,这些评估结果在其[技术报告](https://drive.google.com/file/d/1cN - b9GnWtHzQRoE7M7gAEyivY0kl4BYs/view)中有所报告。
📄 许可证
本模型使用BigCode Open RAIL - M v1许可证。
📖 引用
BibTeX:
@article{Tunstall2023starchat-alpha,
author = {Tunstall, Lewis and Lambert, Nathan and Rajani, Nazneen and Beeching, Edward and Le Scao, Teven and von Werra, Leandro and Han, Sheon and Schmid, Philipp and Rush, Alexander},
title = {Creating a Coding Assistant with StarCoder},
journal = {Hugging Face Blog},
year = {2023},
note = {https://huggingface.co/blog/starchat},
}