🚀 Mamba - GPT - 3B - V4模型
Mamba - GPT - 3B - V4是一款出色的3B模型,在Open LLM排行榜上表現卓越,性能超越了dolly - v2 - 12b,為用戶提供高質量的語言處理能力。
🚀 快速開始
若要在配備GPU的機器上使用transformers
庫調用此模型,首先需確保安裝了transformers
、accelerate
和torch
庫:
pip install transformers==4.29.2
pip install accelerate==0.19.0
pip install torch==2.0.0
接著,運行以下Python代碼:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("CobraMamba/mamba-gpt-3b-v4")
model = AutoModelForCausalLM.from_pretrained("CobraMamba/mamba-gpt-3b-v4", trust_remote_code=True, torch_dtype=torch.float16)
input_content = "Your text here"
input_ids = tokenizer.encode(input_content, return_tensors="pt")
output = model.generate(input_ids, max_length=128, temperature=0.7)
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(output_text)
✨ 主要特性
- 卓越性能:在Open LLM排行榜上表現優異,超越dolly - v2 - 12b,平均得分達45.2。
- 多數據集訓練:基於多個優質數據集進行訓練,包括Stanford Alpaca、Open Assistant等。
- 可擴展性:訓練代碼和數據後續將在Github開源,方便開發者進一步研究和擴展。
📦 安裝指南
要使用該模型,需在有GPU的機器上安裝以下依賴庫:
pip install transformers==4.29.2
pip install accelerate==0.19.0
pip install torch==2.0.0
💻 使用示例
基礎用法
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("CobraMamba/mamba-gpt-3b-v4")
model = AutoModelForCausalLM.from_pretrained("CobraMamba/mamba-gpt-3b-v4", trust_remote_code=True, torch_dtype=torch.float16)
input_content = "Your text here"
input_ids = tokenizer.encode(input_content, return_tensors="pt")
output = model.generate(input_ids, max_length=128, temperature=0.7)
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(output_text)
📚 詳細文檔
模型性能
指標 |
數值 |
MMLU (5 - shot) |
30.0 |
ARC (25 - shot) |
42.6 |
HellaSwag (10 - shot) |
71.0 |
TruthfulQA (0 - shot) |
37.3 |
平均值 |
45.2 |
我們使用了SOTA(最先進技術)的Language Model Evaluation Harness來進行上述基準測試。
訓練數據集
mamba - gpt - 3b - v4
在多個數據集上進行訓練:
模型概述
我們對OpenLLaMA模型進行了微調,在多個評估子任務中超越了原始模型,使其成為目前性能最佳的3B模型之一,性能可與llama - 7b相媲美。
- 基礎模型:[openlm - research/open_llama_3b_v2](https://huggingface.co/openlm - research/open_llama_3b_v2)
訓練代碼和數據
訓練代碼和數據後續將在Github(https://github.com/chi2liu/mamba - gpt - 3b)上開源。
🔧 技術細節
- 測試環境:hf - causal (pretrained = CobraMamba/mamba - gpt - 3b - v4),限制:無,提供描述:否,少樣本數量:0,批量大小:無。
- 測試結果:在0 - shot測試下的性能大多優於acrastt/Marx - 3B - V2。
📄 許可證
本項目採用Apache - 2.0許可證。
📋 免責聲明
在使用本倉庫提供的大語言模型之前,請仔細閱讀本免責聲明。使用該模型即表示您同意以下條款和條件。
⚠️ 重要提示
- 偏差與冒犯性:該大語言模型基於多種互聯網文本數據進行訓練,這些數據可能包含有偏差、種族主義、冒犯性或其他不適當的內容。使用此模型即表示您承認並接受生成的內容有時可能存在偏差或產生冒犯性或不適當的內容。本倉庫的開發者不支持、認可或推廣任何此類內容或觀點。
- 侷限性:該大語言模型是基於人工智能的工具,並非人類。它可能會產生錯誤、無意義或不相關的回覆。用戶有責任對生成的內容進行批判性評估,並自行決定是否使用。
- 風險自負:使用此大語言模型的用戶必須對使用該工具可能產生的任何後果承擔全部責任。本倉庫的開發者和貢獻者不對因使用或濫用所提供的模型而導致的任何損害、損失或傷害承擔責任。