Nous-Yarn-Mistral-7b-128k 是一种最先进的语言模型,用于处理长篇文本语境,采用 YaRN 扩展方法对长篇文本数据进行了 1500 步的进一步预训练。它是 Mistral-7B-v0.1 的扩展版本,支持 128k 令牌的语境窗口。
要使用,加载模型时传递 trust_remote_code=True 参数,例如:
model = AutoModelForCausalLM.from_pretrained("NousResearch/Yarn-Mistral-7b-128k", use_flash_attention_2=True, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)此外,您需要使用最新版本的 transformers(在 4.35 版本发布之前)。
pip install git+https://github.com/huggingface/transformers长文本语境基准测试:
短文本语境基准测试显示质量下降最小:
https://huggingface.co/NousResearch/Yarn-Mistral-7b-128k
Copyright © 2025 AI图片论坛 版权所有. 站点地图