🚀 LLaMa-65b-instruct 模型卡片
本模型基于LLaMA架构开发,可处理长输入序列,在多个基准测试中表现良好,适用于文本生成任务。
🚀 快速开始
本模型已在A100 80GB上进行测试,借助rope_scaling
选项,能够处理多达10k以上的输入令牌。
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
tokenizer = AutoTokenizer.from_pretrained("upstage/llama-65b-instruct")
model = AutoModelForCausalLM.from_pretrained(
"upstage/llama-65b-instruct",
device_map="auto",
torch_dtype=torch.float16,
load_in_8bit=True,
rope_scaling={"type": "dynamic", "factor": 2}
)
prompt = "### User:\nThomas is healthy, but he has to go to the hospital. What could be the reasons?\n\n### Assistant:\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
del inputs["token_type_ids"]
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
✨ 主要特性
- 具有不同的模型参数大小和序列长度,提供多种选择。
- 能够处理多达10k以上的输入令牌,适应长文本输入。
- 在多个基准测试中表现良好,具有较高的性能。
📦 安装指南
文档未提及安装步骤,暂不提供。
💻 使用示例
基础用法
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
tokenizer = AutoTokenizer.from_pretrained("upstage/llama-65b-instruct")
model = AutoModelForCausalLM.from_pretrained(
"upstage/llama-65b-instruct",
device_map="auto",
torch_dtype=torch.float16,
load_in_8bit=True,
rope_scaling={"type": "dynamic", "factor": 2}
)
prompt = "### User:\nThomas is healthy, but he has to go to the hospital. What could be the reasons?\n\n### Assistant:\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
del inputs["token_type_ids"]
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
📚 详细文档
模型详情
数据集详情
使用的数据集
- Orca风格数据集
- 除上述数据集外,未使用其他数据
提示模板
### System:
{System}
### User:
{User}
### Assistant:
{Assistant}
硬件和软件
评估结果
概述
主要结果
H4分数复现脚本
# 克隆仓库
git clone https://github.com/EleutherAI/lm-evaluation-harness.git
# 检出特定提交版本
git checkout b281b0921b636bc36ad05c0b0b0763bd6dd43463
# 切换到仓库目录
cd lm-evaluation-harness
伦理问题
伦理考量
- 由于我们在模型的训练过程中未包含基准测试集或训练集,因此不存在伦理问题。
联系我们
为何选择Upstage大语言模型?
Upstage的大语言模型研究取得了显著成果。截至8月1日,我们的70B模型在openLLM排名中位居榜首,成为目前全球领先的模型。鉴于将私有大语言模型应用于实际业务的巨大潜力,我们邀请您轻松应用私有大语言模型,并使用您自己的数据进行微调。如需无缝且定制化的解决方案,请随时与我们联系。► 点击此处联系