kiel2 commited on
Commit
b69d41c
·
verified ·
1 Parent(s): 7403ad0

Upload fully merged KielGen-Pro model (16-bit safetensors & 4-bit ready)

Browse files
README.md CHANGED
@@ -1,13 +1,51 @@
1
  ---
2
  base_model: deepseek-ai/Janus-Pro-1B
3
- library_name: peft
4
  tags:
5
  - multimodal
6
- - lora
7
- - kielgen-pro
8
  - janus-pro
 
 
 
 
9
  ---
10
 
11
- # KielGen-Pro Phase 1 LoRA Adapters
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- This repository contains Phase 1 LoRA weights for **KielGen-Pro**, fine-tuned on a multi-domain curriculum (UI/Code, Artistic styling, and Reasoning) using `Janus-Pro-1B`.
 
 
 
 
 
 
 
1
  ---
2
  base_model: deepseek-ai/Janus-Pro-1B
3
+ library_name: transformers
4
  tags:
5
  - multimodal
 
 
6
  - janus-pro
7
+ - kielgen-pro
8
+ - lora-merged
9
+ - 4-bit
10
+ - 16-bit
11
  ---
12
 
13
+ # KielGen-Pro (Merged 16-bit & 4-bit Ready)
14
+
15
+ This repository contains the fully merged **KielGen-Pro** multimodal model, fine-tuned from `Janus-Pro-1B` on a custom 10,000-sample curriculum.
16
+
17
+ ## Deployment Instructions
18
+
19
+ ### Load in 16-Bit (Full Precision)
20
+ ```python
21
+ import torch
22
+ from janus.models import MultiModalityCausalLM
23
+
24
+ model = MultiModalityCausalLM.from_pretrained(
25
+ "kiel2/KielGen-Pro",
26
+ torch_dtype=torch.float16,
27
+ device_map="auto",
28
+ trust_remote_code=True
29
+ )
30
+ ```
31
+
32
+ ### Load in Memory-Efficient 4-Bit
33
+ ```python
34
+ import torch
35
+ from janus.models import MultiModalityCausalLM
36
+ from transformers import BitsAndBytesConfig
37
+
38
+ quantization_config = BitsAndBytesConfig(
39
+ load_in_4bit=True,
40
+ bnb_4bit_compute_dtype=torch.float16,
41
+ bnb_4bit_quant_type="nf4",
42
+ bnb_4bit_use_double_quant=True
43
+ )
44
 
45
+ model = MultiModalityCausalLM.from_pretrained(
46
+ "kiel2/KielGen-Pro",
47
+ quantization_config=quantization_config,
48
+ device_map="auto",
49
+ trust_remote_code=True
50
+ )
51
+ ```
config.json ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "aligner_config": {
3
+ "cls": "MlpProjector",
4
+ "model_type": "aligner",
5
+ "params": {
6
+ "depth": 2,
7
+ "input_dim": 1024,
8
+ "n_embed": 2048,
9
+ "projector_type": "mlp_gelu"
10
+ }
11
+ },
12
+ "architectures": [
13
+ "MultiModalityCausalLM"
14
+ ],
15
+ "dtype": "float16",
16
+ "gen_aligner_config": {
17
+ "cls": "MlpProjector",
18
+ "model_type": "gen_aligner",
19
+ "params": {
20
+ "depth": 2,
21
+ "input_dim": 8,
22
+ "n_embed": 2048,
23
+ "projector_type": "mlp_gelu"
24
+ }
25
+ },
26
+ "gen_head_config": {
27
+ "cls": "vision_head",
28
+ "model_type": "gen_head",
29
+ "params": {
30
+ "image_token_embed": 2048,
31
+ "image_token_size": 16384,
32
+ "n_embed": 2048
33
+ }
34
+ },
35
+ "gen_vision_config": {
36
+ "cls": "VQ-16",
37
+ "model_type": "gen_vision",
38
+ "params": {
39
+ "image_token_size": 16384,
40
+ "n_embed": 8
41
+ }
42
+ },
43
+ "language_config": {
44
+ "attention_bias": false,
45
+ "attention_dropout": 0.0,
46
+ "bos_token_id": 1,
47
+ "dtype": "bfloat16",
48
+ "eos_token_id": 2,
49
+ "head_dim": 128,
50
+ "hidden_act": "silu",
51
+ "hidden_size": 2048,
52
+ "initializer_range": 0.02,
53
+ "intermediate_size": 5632,
54
+ "max_position_embeddings": 16384,
55
+ "mlp_bias": false,
56
+ "model_type": "llama",
57
+ "num_attention_heads": 16,
58
+ "num_hidden_layers": 24,
59
+ "num_key_value_heads": 16,
60
+ "pad_token_id": null,
61
+ "pretraining_tp": 1,
62
+ "rms_norm_eps": 1e-06,
63
+ "rope_parameters": {
64
+ "rope_theta": 10000.0,
65
+ "rope_type": "default"
66
+ },
67
+ "tie_word_embeddings": false,
68
+ "use_cache": true,
69
+ "vocab_size": 102400
70
+ },
71
+ "model_type": "multi_modality",
72
+ "transformers_version": "5.16.1",
73
+ "vision_config": {
74
+ "cls": "CLIPVisionTower",
75
+ "model_type": "vision",
76
+ "params": {
77
+ "image_size": 384,
78
+ "model_name": "siglip_large_patch16_384",
79
+ "select_feature": "same",
80
+ "select_layer": -1
81
+ }
82
+ }
83
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ae45710ef842ae7428731192c407fd9d5b45c967f40804230b0f4f2736ec732
3
+ size 4178705502
processor_config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_special_token": false,
3
+ "ignore_id": -100,
4
+ "image_end_tag": "<end_of_image>",
5
+ "image_processor": {
6
+ "background_color": [
7
+ 127,
8
+ 127,
9
+ 127
10
+ ],
11
+ "do_normalize": true,
12
+ "image_mean": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "image_processor_type": "VLMImageProcessor",
18
+ "image_size": 384,
19
+ "image_std": [
20
+ 0.5,
21
+ 0.5,
22
+ 0.5
23
+ ],
24
+ "min_size": 14,
25
+ "rescale_factor": 0.00392156862745098
26
+ },
27
+ "image_start_tag": "<begin_of_image>",
28
+ "image_tag": "<image_placeholder>",
29
+ "mask_prompt": true,
30
+ "num_image_tokens": 576,
31
+ "pad_tag": "<\uff5c\u2581pad\u2581\uff5c>",
32
+ "processor_class": "VLChatProcessor",
33
+ "sft_format": "deepseek"
34
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": null,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|begin▁of▁sentence|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|end▁of▁sentence|>",
7
+ "extra_special_tokens": [
8
+ "<image_placeholder>",
9
+ "<patch_placeholder>",
10
+ "<|ref|>",
11
+ "<|/ref|>",
12
+ "<|det|>",
13
+ "<|/det|>",
14
+ "<|grounding|>",
15
+ "<|User|>",
16
+ "<|Assistant|>"
17
+ ],
18
+ "is_local": false,
19
+ "local_files_only": false,
20
+ "model_max_length": 16384,
21
+ "pad_token": "<|▁pad▁|>",
22
+ "processor_class": "VLChatProcessor",
23
+ "tokenizer_class": "LlamaTokenizer",
24
+ "unk_token": null,
25
+ "use_default_system_prompt": true
26
+ }