h2o-danube2-1.8b-sft是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-sft",
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)
)在使用本仓库提供的大型语言模型前,请仔细阅读本免责声明。您对本模型的使用即表示您同意以下条款和条件。
通过使用本仓库提供的大型语言模型,您同意接受并遵守本免责声明中所述的条款和条件。如果您不同意本免责声明的任何部分,您应避免使用本模型及其生成的任何内容。