🚀 Chicka-Mistral-3x7b模型
Chicka-Mistral-3x7b是一个基于混合专家(Mixture of Experts)技术融合的大语言模型,它整合了三个基于Mistral架构的模型,在多种自然语言处理任务中展现出卓越的性能。
🚀 快速开始
使用以下Python代码示例,你可以快速加载并使用Chicka-Mistral-3x7b模型进行对话生成:
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda"
model = AutoModelForCausalLM.from_pretrained("Chickaboo/Chicka-Mistral-3x7b")
tokenizer = AutoTokenizer.from_pretrained("Chickaboo/Chicka-Mixtral-3x7b")
messages = [
{"role": "user", "content": "What is your favourite condiment?"},
{"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
{"role": "user", "content": "Do you have mayonnaise recipes?"}
]
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
model_inputs = encodeds.to(device)
model.to(device)
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
✨ 主要特性
- 混合专家架构:融合了三个基于Mistral的模型,分别在对话、代码和数学领域具有专长,实现了多领域能力的增强。
- 高性能表现:在多个基准测试中表现出色,如ARC、Hellaswag、TruthfulQA等,展现了其在知识理解、推理和生成方面的强大能力。
📦 安装指南
本README未提供具体安装步骤,你可以参考transformers
库的官方文档进行模型的安装和使用。
💻 使用示例
基础用法
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda"
model = AutoModelForCausalLM.from_pretrained("Chickaboo/Chicka-Mistral-3x7b")
tokenizer = AutoTokenizer.from_pretrained("Chickaboo/Chicka-Mixtral-3x7b")
messages = [
{"role": "user", "content": "What is your favourite condiment?"},
{"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
{"role": "user", "content": "Do you have mayonnaise recipes?"}
]
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
model_inputs = encodeds.to(device)
model.to(device)
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
📚 详细文档
模型描述
该模型是一个基于混合专家(Mixture of Experts)技术融合的大语言模型,由三个基于Mistral的模型组成:
- 基础模型/对话专家:openchat/openchat-3.5-0106
- 代码专家:beowolx/CodeNinja-1.0-OpenChat-7B
- 数学专家:meta-math/MetaMath-Mistral-7B
以下是合并过程中使用的Mergekit配置:
base_model: openchat/openchat-3.5-0106
experts:
- source_model: openchat/openchat-3.5-0106
positive_prompts:
- "chat"
- "assistant"
- "tell me"
- "explain"
- "I want"
- source_model: beowolx/CodeNinja-1.0-OpenChat-7B
positive_prompts:
- "code"
- "python"
- "javascript"
- "programming"
- "algorithm"
- "C#"
- "C++"
- "debug"
- "runtime"
- "html"
- "command"
- "nodejs"
- source_model: meta-math/MetaMath-Mistral-7B
positive_prompts:
- "reason"
- "math"
- "mathematics"
- "solve"
- "count"
- "calculate"
- "arithmetic"
- "algebra"
开放大语言模型排行榜
基准测试 |
Chicka-Mixtral-3X7B |
Mistral-7B-Instruct-v0.2 |
Meta-Llama-3-8B |
平均分 |
69.19 |
60.97 |
62.55 |
ARC |
64.08 |
59.98 |
59.47 |
Hellaswag |
83.96 |
83.31 |
82.09 |
MMLU |
64.87 |
64.16 |
66.67 |
TruthfulQA |
50.51 |
42.15 |
43.95 |
Winogrande |
81.06 |
78.37 |
77.35 |
GSM8K |
70.66 |
37.83 |
45.79 |
📄 许可证
本模型采用MIT许可证。