llama2
{
"_name_or_path": "TheBloke/Llama-2-7B-fp16",
"architectures": [
"LlamaForCausalLM"
],
"bos_token_id": 1,
"eos_token_id": 2,
"hidden_act": "silu",
"hidden_size": 4096,
"initializer_range": 0.02,
"intermediate_size": 11008,
"max_position_embeddings": 2048,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 32,
"pad_token_id": 0,
"rms_norm_eps": 1e-05,
"tie_word_embeddings": false,
"torch_dtype": "float32",
"transformers_version": "4.30.2",
"use_cache": true,
"vocab_size": 32000
}
llama3:
{
"_name_or_path": "../../llama-3-8b",
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 128000,
"eos_token_id": 128001,
"hidden_act": "silu",
"hidden_size": 4096,
"initializer_range": 0.02,
"intermediate_size": 14336,
"max_position_embeddings": 8192,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 32,
"num_key_value_heads": 8,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 500000.0,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.39.3",
"use_cache": true,
"vocab_size": 128256
}
区别:
"bos_token_id": 128000, 跟2不一样
"eos_token_id": 128001, 跟2不一样
"intermediate_size": 14336,比2大
"max_position_embeddings": 8192,比2大 2只有2k说明句子长度变成8k了.
"torch_dtype": "bfloat16", 2代用的32位来存储的. 说明16位模型是更好的效率的方案.
"transformers_version": "4.38.2", 需要的transformers的版本也更高了.
"vocab_size": 128256 #添加了大量的vocab_size 之前只有3w2
"num_key_value_heads": 8, key value 的维度比q要小四倍.
整体上都是维度上的微调和字典增加.
ps
可以看到翻了这个vocab, 一个中文都没有, 这下好了老美知道我们遥遥领先了,已经不需要他们的中文支持了.这下稳了,欧耶.剩下喜欢中文llama3的自己调用vocab.add_token添加中文token再finetune吧.
试了,3代可以编码中文, 只不过编码之后的文字很奇怪.
具体中文能力还是看测试吧.