初始化项目,由ModelHub XC社区提供模型
Model: North-ML1/willow-alpha Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
15
README.md
Normal file
15
README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
license: mit
|
||||
tags:
|
||||
- llama
|
||||
- pytorch
|
||||
- causal-lm
|
||||
- base-model
|
||||
- north-ml
|
||||
- forge
|
||||
language:
|
||||
- en
|
||||
pipeline_tag: text-generation
|
||||
---
|
||||
|
||||
<span style="font-size: 50px;">Willow Alpha is a early stage version of Forge-1V</span>
|
||||
25
config.json
Normal file
25
config.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"architectures": [
|
||||
"LlamaForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"bos_token_id": 1,
|
||||
"eos_token_id": 2,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 1024,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 2816,
|
||||
"max_position_embeddings": 2048,
|
||||
"mlp_bias": false,
|
||||
"model_type": "llama",
|
||||
"num_attention_heads": 16,
|
||||
"num_hidden_layers": 24,
|
||||
"num_key_value_heads": 4,
|
||||
"pad_token_id": 0,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_theta": 10000.0,
|
||||
"tie_word_embeddings": true,
|
||||
"torch_dtype": "bfloat16",
|
||||
"use_cache": true,
|
||||
"vocab_size": 16386
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c6162933e3ab803c93c69c9691803f16b4ed8743aad21968156b4fbc3ba61134
|
||||
size 1149472840
|
||||
225
model.safetensors.index.json
Normal file
225
model.safetensors.index.json
Normal file
@@ -0,0 +1,225 @@
|
||||
{
|
||||
"metadata": {
|
||||
"total_size": 1149448192
|
||||
},
|
||||
"weight_map": {
|
||||
"model.embed_tokens.weight": "model.safetensors",
|
||||
"model.layers.0.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.0.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.0.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.0.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.0.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.0.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.0.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.0.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.0.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.1.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.1.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.1.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.1.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.1.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.1.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.1.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.1.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.1.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.2.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.2.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.2.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.2.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.2.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.2.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.2.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.2.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.2.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.3.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.3.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.3.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.3.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.3.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.3.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.3.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.3.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.3.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.4.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.4.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.4.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.4.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.4.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.4.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.4.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.4.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.4.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.5.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.5.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.5.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.5.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.5.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.5.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.5.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.5.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.5.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.6.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.6.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.6.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.6.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.6.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.6.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.6.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.6.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.6.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.7.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.7.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.7.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.7.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.7.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.7.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.7.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.7.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.7.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.8.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.8.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.8.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.8.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.8.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.8.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.8.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.8.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.8.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.9.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.9.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.9.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.9.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.9.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.9.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.9.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.9.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.9.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.10.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.10.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.10.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.10.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.10.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.10.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.10.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.10.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.10.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.11.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.11.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.11.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.11.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.11.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.11.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.11.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.11.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.11.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.12.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.12.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.12.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.12.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.12.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.12.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.12.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.12.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.12.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.13.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.13.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.13.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.13.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.13.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.13.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.13.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.13.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.13.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.14.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.14.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.14.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.14.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.14.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.14.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.14.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.14.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.14.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.15.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.15.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.15.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.15.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.15.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.15.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.15.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.15.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.15.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.16.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.16.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.16.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.16.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.16.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.16.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.16.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.16.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.16.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.17.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.17.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.17.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.17.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.17.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.17.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.17.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.17.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.17.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.18.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.18.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.18.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.18.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.18.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.18.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.18.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.18.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.18.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.19.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.19.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.19.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.19.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.19.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.19.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.19.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.19.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.19.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.20.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.20.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.20.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.20.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.20.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.20.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.20.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.20.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.20.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.21.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.21.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.21.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.21.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.21.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.21.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.21.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.21.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.21.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.22.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.22.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.22.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.22.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.22.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.22.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.22.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.22.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.22.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.layers.23.self_attn.q_proj.weight": "model.safetensors",
|
||||
"model.layers.23.self_attn.k_proj.weight": "model.safetensors",
|
||||
"model.layers.23.self_attn.v_proj.weight": "model.safetensors",
|
||||
"model.layers.23.self_attn.o_proj.weight": "model.safetensors",
|
||||
"model.layers.23.mlp.gate_proj.weight": "model.safetensors",
|
||||
"model.layers.23.mlp.up_proj.weight": "model.safetensors",
|
||||
"model.layers.23.mlp.down_proj.weight": "model.safetensors",
|
||||
"model.layers.23.input_layernorm.weight": "model.safetensors",
|
||||
"model.layers.23.post_attention_layernorm.weight": "model.safetensors",
|
||||
"model.norm.weight": "model.safetensors"
|
||||
}
|
||||
}
|
||||
14
special_tokens_map.json
Normal file
14
special_tokens_map.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"bos_token": "<s>",
|
||||
"eos_token": "</s>",
|
||||
"unk_token": "<unk>",
|
||||
"pad_token": "<pad>",
|
||||
"additional_special_tokens": [
|
||||
"<|user|>",
|
||||
"<|assistant|>",
|
||||
"<|system|>",
|
||||
"<|end|>",
|
||||
"<|im_start|>",
|
||||
"<|im_end|>"
|
||||
]
|
||||
}
|
||||
81058
tokenizer.json
Normal file
81058
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
17
tokenizer_config.json
Normal file
17
tokenizer_config.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"model_max_length": 2048,
|
||||
"bos_token": "<s>",
|
||||
"eos_token": "</s>",
|
||||
"unk_token": "<unk>",
|
||||
"pad_token": "<pad>",
|
||||
"additional_special_tokens": [
|
||||
"<|user|>",
|
||||
"<|assistant|>",
|
||||
"<|system|>",
|
||||
"<|end|>",
|
||||
"<|im_start|>",
|
||||
"<|im_end|>"
|
||||
],
|
||||
"tokenizer_class": "PreTrainedTokenizerFast",
|
||||
"chat_template": "{% for message in messages %}{% if message['role'] == 'system' %}<|im_start|>system\n{{ message['content'] }}<|im_end|>\n{% elif message['role'] == 'user' %}<|im_start|>user\n{{ message['content'] }}<|im_end|>\n{% elif message['role'] == 'assistant' %}<|im_start|>assistant\n{{ message['content'] }}<|im_end|>\n{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant\n{% endif %}"
|
||||
}
|
||||
21
vision_adapter/README.md
Normal file
21
vision_adapter/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
license: mit
|
||||
---
|
||||
|
||||
# Forge-1V Micro Vision Adapter Scaffold
|
||||
|
||||
This folder contains an experimental, untrained micro vision-adapter scaffold for future Forge-1V work.
|
||||
|
||||
It is intentionally separate from the main text checkpoint:
|
||||
|
||||
- The main `config.json` remains Llama-compatible.
|
||||
- The GGUF export remains text-only.
|
||||
- These files do not make the released model able to view images.
|
||||
|
||||
Suggested target design:
|
||||
|
||||
- Tiny patch encoder: 3-channel images to a small vision width.
|
||||
- Projection: vision width to the 1024-dimensional Forge text hidden size.
|
||||
- Prefix tokens: projected visual tokens can be prepended to the text sequence in a future custom multimodal training run.
|
||||
|
||||
Approximate extra parameters for the scaffold design are well under 1M, keeping the total system under 400M parameters.
|
||||
8
vision_adapter/config.json
Normal file
8
vision_adapter/config.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"image_size": 224,
|
||||
"patch_size": 16,
|
||||
"vision_width": 128,
|
||||
"text_hidden_size": 1024,
|
||||
"num_prefix_tokens": 16,
|
||||
"status": "experimental_untrained_scaffold"
|
||||
}
|
||||
38
vision_adapter/forge_micro_vision.py
Normal file
38
vision_adapter/forge_micro_vision.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
|
||||
@dataclass
|
||||
class ForgeMicroVisionConfig:
|
||||
image_size: int = 224
|
||||
patch_size: int = 16
|
||||
vision_width: int = 128
|
||||
text_hidden_size: int = 1024
|
||||
num_prefix_tokens: int = 16
|
||||
|
||||
|
||||
class ForgeMicroVisionAdapter(nn.Module):
|
||||
"""Tiny untrained image-to-prefix adapter scaffold for Forge-1V experiments."""
|
||||
|
||||
def __init__(self, config: ForgeMicroVisionConfig = ForgeMicroVisionConfig()):
|
||||
super().__init__()
|
||||
self.config = config
|
||||
self.patch_embed = nn.Conv2d(
|
||||
3,
|
||||
config.vision_width,
|
||||
kernel_size=config.patch_size,
|
||||
stride=config.patch_size,
|
||||
bias=False,
|
||||
)
|
||||
self.pool = nn.AdaptiveAvgPool1d(config.num_prefix_tokens)
|
||||
self.norm = nn.LayerNorm(config.vision_width)
|
||||
self.proj = nn.Linear(config.vision_width, config.text_hidden_size, bias=False)
|
||||
|
||||
def forward(self, images: torch.Tensor) -> torch.Tensor:
|
||||
patches = self.patch_embed(images)
|
||||
tokens = patches.flatten(2)
|
||||
tokens = self.pool(tokens).transpose(1, 2)
|
||||
tokens = self.norm(tokens)
|
||||
return self.proj(tokens)
|
||||
21
vision_adapter/vision_adapter/README.md
Normal file
21
vision_adapter/vision_adapter/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
license: mit
|
||||
---
|
||||
|
||||
# Forge-1V Micro Vision Adapter Scaffold
|
||||
|
||||
This folder contains an experimental, untrained micro vision-adapter scaffold for future Forge-1V work.
|
||||
|
||||
It is intentionally separate from the main text checkpoint:
|
||||
|
||||
- The main `config.json` remains Llama-compatible.
|
||||
- The GGUF export remains text-only.
|
||||
- These files do not make the released model able to view images.
|
||||
|
||||
Suggested target design:
|
||||
|
||||
- Tiny patch encoder: 3-channel images to a small vision width.
|
||||
- Projection: vision width to the 1024-dimensional Forge text hidden size.
|
||||
- Prefix tokens: projected visual tokens can be prepended to the text sequence in a future custom multimodal training run.
|
||||
|
||||
Approximate extra parameters for the scaffold design are well under 1M, keeping the total system under 400M parameters.
|
||||
8
vision_adapter/vision_adapter/config.json
Normal file
8
vision_adapter/vision_adapter/config.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"image_size": 224,
|
||||
"patch_size": 16,
|
||||
"vision_width": 128,
|
||||
"text_hidden_size": 1024,
|
||||
"num_prefix_tokens": 16,
|
||||
"status": "experimental_untrained_scaffold"
|
||||
}
|
||||
38
vision_adapter/vision_adapter/forge_micro_vision.py
Normal file
38
vision_adapter/vision_adapter/forge_micro_vision.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
|
||||
@dataclass
|
||||
class ForgeMicroVisionConfig:
|
||||
image_size: int = 224
|
||||
patch_size: int = 16
|
||||
vision_width: int = 128
|
||||
text_hidden_size: int = 1024
|
||||
num_prefix_tokens: int = 16
|
||||
|
||||
|
||||
class ForgeMicroVisionAdapter(nn.Module):
|
||||
"""Tiny untrained image-to-prefix adapter scaffold for Forge-1V experiments."""
|
||||
|
||||
def __init__(self, config: ForgeMicroVisionConfig = ForgeMicroVisionConfig()):
|
||||
super().__init__()
|
||||
self.config = config
|
||||
self.patch_embed = nn.Conv2d(
|
||||
3,
|
||||
config.vision_width,
|
||||
kernel_size=config.patch_size,
|
||||
stride=config.patch_size,
|
||||
bias=False,
|
||||
)
|
||||
self.pool = nn.AdaptiveAvgPool1d(config.num_prefix_tokens)
|
||||
self.norm = nn.LayerNorm(config.vision_width)
|
||||
self.proj = nn.Linear(config.vision_width, config.text_hidden_size, bias=False)
|
||||
|
||||
def forward(self, images: torch.Tensor) -> torch.Tensor:
|
||||
patches = self.patch_embed(images)
|
||||
tokens = patches.flatten(2)
|
||||
tokens = self.pool(tokens).transpose(1, 2)
|
||||
tokens = self.norm(tokens)
|
||||
return self.proj(tokens)
|
||||
Reference in New Issue
Block a user