🚀 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許可證。