Amberchat
AmberChat是基于LLM360/Amber微调的指令跟随模型,属于LLM360的Pebble模型系列。
下载量 4,790
发布时间 : 11/30/2023
模型简介
AmberChat是一个基于LLM360/Amber微调的指令跟随模型,主要用于文本生成任务。
模型特点
高性能
在MT-Bench评估中得分5.428125,优于Falcon-40B-Instruct和接近MPT-7B-Chat。
指令跟随
能够理解和执行复杂的指令,提供详细的回答。
开源
采用Apache 2.0许可证,完全开源。
模型能力
文本生成
指令跟随
问答系统
使用案例
家庭生活
电视安装指导
提供如何安全地将电视安装在干墙上的详细步骤。
确保电视和墙体的长期使用安全。
教育
类比推理
解释快乐之于悲伤,如同平静之于焦虑或压力。
帮助理解抽象概念之间的关系。
娱乐
生日派对策划
为10岁孩子的生日派对提供创意建议。
提供多种有趣的派对活动方案。
🚀 AmberChat
AmberChat是一个基于指令跟随的模型,它是在LLM360/Amber的基础上进行微调得到的。AmberChat属于LLM360的Pebble模型系列,能够为用户提供准确且详细的回答。
🚀 快速开始
你可以按照以下步骤加载和使用AmberChat模型:
import torch
from transformers import LlamaTokenizer, LlamaForCausalLM
tokenizer = LlamaTokenizer.from_pretrained("LLM360/AmberChat")
model = LlamaForCausalLM.from_pretrained("LLM360/AmberChat")
#template adapated from fastchat
template= "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.\n### Human: Got any creative ideas for a 10 year old’s birthday?\n### Assistant: Of course! Here are some creative ideas for a 10-year-old's birthday party:\n1. Treasure Hunt: Organize a treasure hunt in your backyard or nearby park. Create clues and riddles for the kids to solve, leading them to hidden treasures and surprises.\n2. Science Party: Plan a science-themed party where kids can engage in fun and interactive experiments. You can set up different stations with activities like making slime, erupting volcanoes, or creating simple chemical reactions.\n3. Outdoor Movie Night: Set up a backyard movie night with a projector and a large screen or white sheet. Create a cozy seating area with blankets and pillows, and serve popcorn and snacks while the kids enjoy a favorite movie under the stars.\n4. DIY Crafts Party: Arrange a craft party where kids can unleash their creativity. Provide a variety of craft supplies like beads, paints, and fabrics, and let them create their own unique masterpieces to take home as party favors.\n5. Sports Olympics: Host a mini Olympics event with various sports and games. Set up different stations for activities like sack races, relay races, basketball shooting, and obstacle courses. Give out medals or certificates to the participants.\n6. Cooking Party: Have a cooking-themed party where the kids can prepare their own mini pizzas, cupcakes, or cookies. Provide toppings, frosting, and decorating supplies, and let them get hands-on in the kitchen.\n7. Superhero Training Camp: Create a superhero-themed party where the kids can engage in fun training activities. Set up an obstacle course, have them design their own superhero capes or masks, and organize superhero-themed games and challenges.\n8. Outdoor Adventure: Plan an outdoor adventure party at a local park or nature reserve. Arrange activities like hiking, nature scavenger hunts, or a picnic with games. Encourage exploration and appreciation for the outdoors.\nRemember to tailor the activities to the birthday child's interests and preferences. Have a great celebration!\n### Human: {prompt}\n### Assistant:"
prompt = "How do I mount a tv to drywall safely?"
input_str = template.format(prompt=prompt)
input_ids = tokenizer(input_str, return_tensors="pt").input_ids
outputs = model.generate(input_ids, max_length=1000)
print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
或者,你也可以使用FastChat:
python3 -m fastchat.serve.cli --model-path LLM360/AmberChat
✨ 主要特性
- 指令跟随能力:能够准确理解用户的指令,并给出详细且有帮助的回答。
- 多场景应用:可用于多种自然语言处理任务,如问答、文本生成等。
💻 使用示例
基础用法
以下是使用AmberChat进行文本生成的示例:
import torch
from transformers import LlamaTokenizer, LlamaForCausalLM
tokenizer = LlamaTokenizer.from_pretrained("LLM360/AmberChat")
model = LlamaForCausalLM.from_pretrained("LLM360/AmberChat")
template= "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.\n### Human: {prompt}\n### Assistant:"
prompt = "How do I mount a tv to drywall safely?"
input_str = template.format(prompt=prompt)
input_ids = tokenizer(input_str, return_tensors="pt").input_ids
outputs = model.generate(input_ids, max_length=1000)
print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
高级用法
你可以使用FastChat来更方便地使用AmberChat:
python3 -m fastchat.serve.cli --model-path LLM360/AmberChat
📚 详细文档
评估结果
模型 | MT-Bench得分 |
---|---|
LLM360/AmberChat | 5.428125 |
LLM360/Amber | 2.48750 |
Falcon-40B-Instruct | 5.17 |
MPT-7B-Chat | 5.42 |
Nous-Hermes-13B | 5.51 |
模型描述
属性 | 详情 |
---|---|
模型类型 | 与LLaMA - 7B架构相同的语言模型 |
支持语言 | 英语 |
许可证 | Apache 2.0 |
更多信息资源 | 指标、完全处理后的Amber预训练数据、微调代码 |
微调细节
数据混合
子集 | 行数 | 许可证 |
---|---|---|
WizardLM/WizardLM_evol_instruct_V2_196k | 143k | |
icybee/share_gpt_90k_v1 | 90k | cc0 - 1.0 |
总计 | 233k |
超参数
超参数 | 值 |
---|---|
总参数 | 6.7B |
隐藏层大小 | 4096 |
中间层大小(MLPs) | 11008 |
注意力头数量 | 32 |
隐藏层数量 | 32 |
RMSNorm ɛ | 1e^ - 6 |
最大序列长度 | 2048 |
词表大小 | 32000 |
训练超参数
训练超参数 | 值 |
---|---|
学习率 | 2e - 5 |
训练轮数 | 3 |
每个设备的训练批次大小 | 2 |
梯度累积步数 | 16 |
热身比例 | 0.04 |
模型最大长度 | 2048 |
使用Ollama运行量化模型
你可以按照以下步骤在个人电脑或笔记本上使用AmberChat的量化版本:
- 首先,按照此处的说明安装Ollama。然后,从TheBloke/AmberChat - GGUF下载一个量化模型检查点(例如8位版本的amberchat.Q8_0.gguf)。使用以下模板在本地创建一个Ollama Modelfile:
FROM amberchat.Q8_0.gguf
TEMPLATE """{{ .System }}
USER: {{ .Prompt }}
ASSISTANT:
"""
SYSTEM """A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
"""
PARAMETER stop "USER:"
PARAMETER stop "ASSISTANT:"
PARAMETER repeat_last_n 0
PARAMETER num_ctx 2048
PARAMETER seed 0
PARAMETER num_predict -1
确保FROM
指令指向下载的检查点文件。
2. 运行以下命令来构建模型:
ollama create amberchat -f Modelfile
- 从命令行运行模型:
ollama run amberchat
你只需要构建一次模型,之后就可以直接运行它。
📄 许可证
AmberChat使用Apache 2.0许可证。
📖 引用
如果你使用了AmberChat,请引用以下论文:
@misc{liu2023llm360,
title={LLM360: Towards Fully Transparent Open-Source LLMs},
author={Zhengzhong Liu and Aurick Qiao and Willie Neiswanger and Hongyi Wang and Bowen Tan and Tianhua Tao and Junbo Li and Yuqi Wang and Suqi Sun and Omkar Pangarkar and Richard Fan and Yi Gu and Victor Miller and Yonghao Zhuang and Guowei He and Haonan Li and Fajri Koto and Liping Tang and Nikhil Ranjan and Zhiqiang Shen and Xuguang Ren and Roberto Iriondo and Cun Mu and Zhiting Hu and Mark Schulze and Preslav Nakov and Tim Baldwin and Eric P. Xing},
year={2023},
eprint={2312.06550},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Phi 2 GGUF
其他
Phi-2是微软开发的一个小型但强大的语言模型,具有27亿参数,专注于高效推理和高质量文本生成。
大型语言模型 支持多种语言
P
TheBloke
41.5M
205
Roberta Large
MIT
基于掩码语言建模目标预训练的大型英语语言模型,采用改进的BERT训练方法
大型语言模型 英语
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基础模型的蒸馏版本,在保持相近性能的同时更轻量高效,适用于序列分类、标记分类等自然语言处理任务。
大型语言模型 英语
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一个多语言大语言模型,针对多语言对话用例进行了优化,在常见的行业基准测试中表现优异。
大型语言模型 英语
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基于100种语言的2.5TB过滤CommonCrawl数据预训练的多语言模型,采用掩码语言建模目标进行训练。
大型语言模型 支持多种语言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基于Transformer架构的英语预训练模型,通过掩码语言建模目标在海量文本上训练,支持文本特征提取和下游任务微调
大型语言模型 英语
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI发布的开放预训练Transformer语言模型套件,参数量从1.25亿到1750亿,旨在对标GPT-3系列性能,同时促进大规模语言模型的开放研究。
大型语言模型 英语
O
facebook
6.3M
198
1
基于transformers库的预训练模型,适用于多种NLP任务
大型语言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多语言大语言模型系列,包含8B、70B和405B参数规模,支持8种语言和代码生成,优化了多语言对话场景。
大型语言模型
Transformers 支持多种语言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基础版是由Google开发的文本到文本转换Transformer模型,参数规模2.2亿,支持多语言NLP任务。
大型语言模型 支持多种语言
T
google-t5
5.4M
702
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98