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