h2o-danube2-1.8b-chat是H2O.ai公司微调的聊天模型,拥有18亿参数。我们发布了该模型的三个版本:
| 模型名称 | 描述 |
|---|---|
| h2oai/h2o-danube2-1.8b-base | 基础模型 |
| h2oai/h2o-danube2-1.8b-sft | SFT微调模型 |
| h2oai/h2o-danube2-1.8b-chat | SFT + DPO微调模型 |
本模型使用H2O LLM Studio进行训练。
我们调整了Llama 2架构,使其总参数约为18亿。详细信息请参考我们的技术报告。我们使用Mistral分词器,词汇量为32,000,并将模型训练到8,192的上下文长度。
模型架构详情如下:
| 超参数 | 值 |
|---|---|
| n_layers | 24 |
| n_heads | 32 |
| n_query_groups | 8 |
| n_embd | 2560 |
| vocab size | 32000 |
| sequence length | 8192 |
from openmind import pipeline, is_torch_npu_available
from openmind_hub import snapshot_download
if is_torch_npu_available():
device = "npu:0"
else:
device = "cpu"
generate_text = pipeline(
model="SY_AICC/h2o-danube2-1.8b-chat",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device=device,)
output = generate_text(
"Why is drinking water so healthy?",
max_new_tokens=100)
print(res[0]["generated_text"])您可以通过指定 load_in_8bit=True 或 load_in_4bit=True 来使用量化方式加载模型。此外,通过设置 device_map=auto,可以在多个 GPU 上进行分片。
MistralForCausalLM(
(model): MistralModel(
(embed_tokens): Embedding(32000, 2560, padding_idx=0)
(layers): ModuleList(
(0-23): 24 x MistralDecoderLayer(
(self_attn): MistralAttention(
(q_proj): Linear(in_features=2560, out_features=2560, bias=False)
(k_proj): Linear(in_features=2560, out_features=640, bias=False)
(v_proj): Linear(in_features=2560, out_features=640, bias=False)
(o_proj): Linear(in_features=2560, out_features=2560, bias=False)
(rotary_emb): MistralRotaryEmbedding()
)
(mlp): MistralMLP(
(gate_proj): Linear(in_features=2560, out_features=6912, bias=False)
(up_proj): Linear(in_features=2560, out_features=6912, bias=False)
(down_proj): Linear(in_features=6912, out_features=2560, bias=False)
(act_fn): SiLU()
)
(input_layernorm): MistralRMSNorm()
(post_attention_layernorm): MistralRMSNorm()
)
)
(norm): MistralRMSNorm()
)
(lm_head): Linear(in_features=2560, out_features=32000, bias=False)
)| 基准测试 | acc_n |
|---|---|
| 平均值 | 48.44 |
| ARC-challenge | 43.43 |
| Hellaswag | 73.54 |
| MMLU | 37.77 |
| TruthfulQA | 39.96 |
| Winogrande | 69.77 |
| GSM8K | 26.16 |
First Turn: 6.23
Second Turn: 5.34
Average: 5.79在使用本仓库提供的大型语言模型前,请仔细阅读本免责声明。您对模型的使用即表示您同意以下条款和条件。
使用本仓库提供的大型语言模型,即表示您同意接受并遵守本免责声明中所述的条款和条件。如果您不同意本免责声明的任何部分,您应避免使用该模型及其生成的任何内容。