许可证: mit
数据集:
- cerebras/SlimPajama-627B
- uonlp/CulturaX
- pg19
- bigcode/starcoderdata
- croissantllm/croissant_dataset
语言:
- fr
- en
任务标签: 文本生成
标签:
- 法律
- 代码
- 文本生成推理
- 艺术
CroissantLLM - 基础GGUF版本(19万步训练,最终版)
本模型属于CroissantLLM计划的一部分,对应经过19万步训练(2.99T tokens)的检查点。
如需体验最终版模型,我们推荐使用聊天版本:https://huggingface.co/croissantllm/CroissantLLMChat-v0.1
论文链接:https://arxiv.org/abs/2402.00786
摘要
我们推出CroissantLLM——一个基于3T英法双语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]))
inputs = tokenizer("Capitales: France -> Paris, Italie -> Rome, Allemagne -> Berlin, Espagne ->", return_tensors="pt", add_special_tokens=True).to(model.device)
tokens = model.generate(**inputs, max_length=100, do_sample=True, top_p=0.95, top_k=60)
print(tokenizer.decode(tokens[0]))