🚀 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},
}