许可证: mit
数据集:
- cerebras/SlimPajama-627B
- uonlp/CulturaX
- pg19
- bigcode/starcoderdata
- croissantllm/croissant_dataset
语言:
- 法语
- 英语
任务标签: 文本生成
标签:
- 法律
- 代码
- 文本生成推理
- 艺术
CroissantLLM - 基础版(19万步,最终版本)
此模型是CroissantLLM计划的一部分,对应训练19万步(2.99万亿token)后的检查点。
如需体验最终模型,我们推荐使用聊天版本:https://huggingface.co/croissantllm/CroissantLLMChat-v0.1
论文链接:https://arxiv.org/abs/2402.00786
摘要
我们推出CroissantLLM——一个基于3万亿英法双语token预训练的13亿参数语言模型,旨在为研究和工业社区提供高性能、完全开源的双语模型,并可在消费级本地硬件上流畅运行。为此,我们首创了以下方法:采用1:1英法预训练数据比例、定制分词器以及双语微调数据集进行本质双语模型训练。我们公开了训练数据集,其中特别包含经过人工筛选、高质量且多样化的法语数据分支。
为评估非英语环境下的性能,我们构建了全新基准测试FrenchBench,涵盖分类与生成任务,从多维度衡量模型在法语中的表现。基于透明性原则并推动大语言模型研究,我们开源了代码库、数十个不同模型规模/训练数据分布/训练步数的检查点,以及微调后的聊天模型和优质翻译模型。通过FMTI框架评估,模型透明度标准达标率达81%,远超多数开源项目。
本项工作丰富了NLP领域生态,突破以往以英语为中心的范式,深化对语言模型多语言能力的理解。
引用
请使用以下格式引用我们的工作:
@misc{faysse2024croissantllm,
title={CroissantLLM: A Truly Bilingual French-English Language Model},
author={Manuel Faysse and Patrick Fernandes and Nuno M. Guerreiro and António Loison and Duarte M. Alves and Caio Corro and Nicolas Boizard and João Alves and Ricardo Rei and Pedro H. Martins and Antoni Bigata Casademunt and François Yvon and André F. T. Martins and Gautier Viaud and Céline Hudelot and Pierre Colombo},
year={2024},
eprint={2402.00786},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
使用说明
本模型为基础版,未针对聊天功能微调,最适合少量示例提示策略。
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "croissantllm/CroissantLLMBase"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map="auto")
inputs = tokenizer("I am so tired I could sleep right now. -> Je suis si fatigué que je pourrais m'endormir maintenant.\nHe is heading to the market. -> Il va au marché.\nWe are running on the beach. ->", return_tensors="pt").to(model.device)
tokens = model.generate(**inputs, max_length=100, do_sample=True, top_p=0.95, top_k=60, temperature=0.3)
print(tokenizer.decode(tokens[0]))