许可证:apache-2.0
数据集:
- giux78/100k-sft-ready-ultrafeedback-ita
语言:
- 意大利语
任务标签:文本生成
Zefiro-7b-beta-ITA-v0.1 模型卡
最后更新:2024年1月11日
Zefiro 是一个基于 Mistral 的意大利语 SFT 微调模型。该项目的目标是创建一套适合意大利语的开源模型和数据集,这是第一个实验性成果。该模型可作为意大利语特定对话任务的基础模型。
模型详情
Zefiro 是将 Zephyr 模型移植到意大利语的成果,使用了 alignment-handbook 的优秀配方。它还从巴里大学开发的 Llamantino 模型中汲取了灵感和见解。在实现过程中,我们结合了上述两种模型的不同方法,同时也借鉴了开源社区的优秀成果。
模型描述
预期用途与限制
该模型最初是在 UltraChat-ITA 的过滤和预处理版本上微调的,这是 UltraChat
数据集的过滤版本,包含 ChatGPT 生成的各种合成对话。
以下是使用 🤗 Transformers 运行模型的方法:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "giux78/zefiro-7b-beta-ITA-v0.1"
model = AutoModelForCausalLM.from_pretrained(model_id)
model.to('cuda')
tokenizer = AutoTokenizer.from_pretrained(model_id, padding_side="left")
sys_prompt = "你是一个乐于助人、尊重他人且诚实的助手。" \
"始终以最有帮助的方式回答,同时确保安全。" \
"回答不得包含有害、不道德、种族主义、性别歧视、有毒、危险或非法内容。" \
"确保回答在社会上是公正和积极的。" \
"如果问题没有意义或与事实不符,请解释原因,而不是错误地回答。" \
"如果不知道问题的答案,请不要分享虚假信息。"
messages = [{ 'content' : sys_prompt, 'role' : 'assistant'},
{'content' : '创建一个每周午餐和晚餐的饮食清单', 'role' : 'user'}]
def generate_text(sys_prompt, user_prompt):
messages = [{ 'content' : sys_prompt, 'role' : 'assistant'},
{'content' : user_prompt, 'role' : 'user'}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
model_inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
generated_ids = model.generate(**model_inputs, max_new_tokens=1024)
return tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
generate_text(sys_prompt, '你对意大利政治有什么看法?')
偏见、风险与限制
Zefiro-7b-beta-ITA-v0.1 尚未通过 RLHF 阶段与人类偏好对齐,也未像 ChatGPT 那样部署响应过滤机制,因此模型可能产生有问题的输出(尤其是在被提示时)。此外,基础模型(mistralai/Mistral-7B-v0.1
)训练数据集的规模和组成尚不明确,但可能包括网络数据和技术来源(如书籍和代码)。参见 Falcon 180B 模型卡 以了解相关示例。
训练数据
我们使用了 UltraChat-ITA 作为训练数据,这是 UltraChat
的过滤版本。在翻译数据集时,我们结合了多种工具和 API,目前仍在评估翻译更多数据集的最佳方法。我们发现翻译阶段非常关键,可能会引入错误的语法和语义。
总结
Zefiro-7b-beta-ITA-v0.1 是基于 mistral-7b 的微调版本,采用 zephyr 方法针对意大利语优化。
引用
@misc{tunstall2023zephyr,
title={Zephyr: Direct Distillation of LM Alignment},
author={Lewis Tunstall and Edward Beeching and Nathan Lambert and Nazneen Rajani and Kashif Rasul and Younes Belkada and Shengyi Huang and Leandro von Werra and Clémentine Fourrier and Nathan Habib and Nathan Sarrazin and Omar Sanseviero and Alexander M. Rush and Thomas Wolf},
year={2023},
eprint={2310.16944},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
@misc{basile2023llamantino,
title={LLaMAntino: LLaMA 2 Models for Effective Text Generation in Italian Language},
author={Pierpaolo Basile and Elio Musacchio and Marco Polignano and Lucia Siciliani and Giuseppe Fiameni and Giovanni Semeraro},
year={2023},
eprint={2312.09993},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
模型卡作者
giux78
模型卡联系方式
ale.ercolani@gmail.com