IMvision12 commited on
Commit
65e4bb8
·
verified ·
1 Parent(s): 9e53345

Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)

Browse files
README.md CHANGED
@@ -4,10 +4,10 @@ license: other
4
  license_name: deepseek
5
  license_link: https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat/blob/main/LICENSE
6
  base_model: deepseek-ai/deepseek-vl-7b-chat
7
- library_name: kerasformers
8
  tags:
9
  - keras
10
- - kerasformers
11
  - deepseek-vl
12
  - vision-language
13
  - image-text-to-text
@@ -17,21 +17,21 @@ tags:
17
  - tf
18
  ---
19
 
20
- ## ***See [our collection](https://huggingface.co/collections/kerasformers/deepseek-vl-6a6ea961fe80d98b7c69b489) for all versions of DeepSeek-VL.***
21
 
22
  # Run DeepSeek-VL with Keras 3: JAX, PyTorch, or TensorFlow
23
 
24
- [![GitHub](https://img.shields.io/badge/GitHub-KerasFormers-black?logo=github)](https://github.com/IMvision12/KerasFormers) [![Docs](https://img.shields.io/badge/Docs-DeepSeek--VL--Hybrid-blue)](https://imvision12.github.io/KerasFormers/deepseek_vl_hybrid/) [![Collection](https://img.shields.io/badge/HF-DeepSeek--VL%20collection-yellow)](https://huggingface.co/collections/kerasformers/deepseek-vl-6a6ea961fe80d98b7c69b489)
25
 
26
- # kerasformers/deepseek_vl_7b_chat
27
 
28
  Paper: [DeepSeek-VL: Towards Real-World Vision-Language Understanding (arXiv:2403.05525)](https://arxiv.org/abs/2403.05525) · [HF Papers](https://huggingface.co/papers/2403.05525)
29
 
30
- DeepSeek-VL **7B hybrid** uses a dual vision tower (SigLIP @384 + SAM-style @1024) and a 3-way aligner for finer detail and small text. Import from `kerasformers.models.deepseek_vl_hybrid` (not `deepseek_vl`).
31
 
32
  For more details on the model, please go to the upstream [model card](https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat).
33
 
34
- Pure-**Keras 3** conversion of [`deepseek-ai/deepseek-vl-7b-chat`](https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
35
 
36
  This is a **vision-language** (chat) checkpoint (`DeepseekVLHybridConditionalGenerate`, 7B chat (SigLIP + SAM hybrid)).
37
 
@@ -42,13 +42,13 @@ import os
42
  os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
43
 
44
  from PIL import Image
45
- from kerasformers.models.deepseek_vl_hybrid import (
46
  DeepseekVLHybridConditionalGenerate,
47
  DeepseekVLHybridProcessor,
48
  )
49
 
50
- model = DeepseekVLHybridConditionalGenerate.from_weights("kerasformers/deepseek_vl_7b_chat")
51
- processor = DeepseekVLHybridProcessor.from_weights("kerasformers/deepseek_vl_7b_chat")
52
 
53
  image = Image.open("your_image.jpg")
54
  inputs = processor(
@@ -66,21 +66,21 @@ outputs = model.generate(**inputs, max_new_tokens=64)
66
  print(processor.decode(outputs[0]))
67
  ```
68
 
69
- Load any DeepSeek-VL variant the same way with `from_weights("kerasformers/<variant>")`:
70
 
71
  | Variant | Hub | Notes |
72
  |---|---|---|
73
- | `deepseek_vl_1.3b_base` | [`kerasformers/deepseek_vl_1.3b_base`](https://huggingface.co/kerasformers/deepseek_vl_1.3b_base) | 1.3B base |
74
- | `deepseek_vl_1.3b_chat` | [`kerasformers/deepseek_vl_1.3b_chat`](https://huggingface.co/kerasformers/deepseek_vl_1.3b_chat) | 1.3B chat |
75
- | `deepseek_vl_7b_base` | [`kerasformers/deepseek_vl_7b_base`](https://huggingface.co/kerasformers/deepseek_vl_7b_base) | 7B hybrid base |
76
- | `deepseek_vl_7b_chat` | [`kerasformers/deepseek_vl_7b_chat`](https://huggingface.co/kerasformers/deepseek_vl_7b_chat) | 7B hybrid chat |
77
 
78
  ## Tips
79
 
80
- - Set `KERAS_BACKEND` **before** importing Keras / kerasformers.
81
  - Prefer `Processor.from_weights(...)` so vision + tokenizer match.
82
  - 7B hybrid is a **different package** than 1.3B; do not mix imports.
83
- - See [docs](https://imvision12.github.io/KerasFormers/deepseek_vl_hybrid/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).
84
  - Community / upstream safetensors still work via the `hf:` prefix, e.g. `DeepseekVLHybridConditionalGenerate.from_weights("hf:deepseek-ai/deepseek-vl-7b-chat")`.
85
 
86
  ## Special Thanks
 
4
  license_name: deepseek
5
  license_link: https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat/blob/main/LICENSE
6
  base_model: deepseek-ai/deepseek-vl-7b-chat
7
+ library_name: zeromodels
8
  tags:
9
  - keras
10
+ - zeromodels
11
  - deepseek-vl
12
  - vision-language
13
  - image-text-to-text
 
17
  - tf
18
  ---
19
 
20
+ ## ***See [our collection](https://huggingface.co/collections/zeromodels/deepseek-vl-6a6ea961fe80d98b7c69b489) for all versions of DeepSeek-VL.***
21
 
22
  # Run DeepSeek-VL with Keras 3: JAX, PyTorch, or TensorFlow
23
 
24
+ [![GitHub](https://img.shields.io/badge/GitHub-ZeroModels-black?logo=github)](https://github.com/IMvision12/ZeroModels) [![Docs](https://img.shields.io/badge/Docs-DeepSeek--VL--Hybrid-blue)](https://imvision12.github.io/ZeroModels/deepseek_vl_hybrid/) [![Collection](https://img.shields.io/badge/HF-DeepSeek--VL%20collection-yellow)](https://huggingface.co/collections/zeromodels/deepseek-vl-6a6ea961fe80d98b7c69b489)
25
 
26
+ # zeromodels/deepseek_vl_7b_chat
27
 
28
  Paper: [DeepSeek-VL: Towards Real-World Vision-Language Understanding (arXiv:2403.05525)](https://arxiv.org/abs/2403.05525) · [HF Papers](https://huggingface.co/papers/2403.05525)
29
 
30
+ DeepSeek-VL **7B hybrid** uses a dual vision tower (SigLIP @384 + SAM-style @1024) and a 3-way aligner for finer detail and small text. Import from `zeromodels.models.deepseek_vl_hybrid` (not `deepseek_vl`).
31
 
32
  For more details on the model, please go to the upstream [model card](https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat).
33
 
34
+ Pure-**Keras 3** conversion of [`deepseek-ai/deepseek-vl-7b-chat`](https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
35
 
36
  This is a **vision-language** (chat) checkpoint (`DeepseekVLHybridConditionalGenerate`, 7B chat (SigLIP + SAM hybrid)).
37
 
 
42
  os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
43
 
44
  from PIL import Image
45
+ from zeromodels.models.deepseek_vl_hybrid import (
46
  DeepseekVLHybridConditionalGenerate,
47
  DeepseekVLHybridProcessor,
48
  )
49
 
50
+ model = DeepseekVLHybridConditionalGenerate.from_weights("zeromodels/deepseek_vl_7b_chat")
51
+ processor = DeepseekVLHybridProcessor.from_weights("zeromodels/deepseek_vl_7b_chat")
52
 
53
  image = Image.open("your_image.jpg")
54
  inputs = processor(
 
66
  print(processor.decode(outputs[0]))
67
  ```
68
 
69
+ Load any DeepSeek-VL variant the same way with `from_weights("zeromodels/<variant>")`:
70
 
71
  | Variant | Hub | Notes |
72
  |---|---|---|
73
+ | `deepseek_vl_1.3b_base` | [`zeromodels/deepseek_vl_1.3b_base`](https://huggingface.co/zeromodels/deepseek_vl_1.3b_base) | 1.3B base |
74
+ | `deepseek_vl_1.3b_chat` | [`zeromodels/deepseek_vl_1.3b_chat`](https://huggingface.co/zeromodels/deepseek_vl_1.3b_chat) | 1.3B chat |
75
+ | `deepseek_vl_7b_base` | [`zeromodels/deepseek_vl_7b_base`](https://huggingface.co/zeromodels/deepseek_vl_7b_base) | 7B hybrid base |
76
+ | `deepseek_vl_7b_chat` | [`zeromodels/deepseek_vl_7b_chat`](https://huggingface.co/zeromodels/deepseek_vl_7b_chat) | 7B hybrid chat |
77
 
78
  ## Tips
79
 
80
+ - Set `KERAS_BACKEND` **before** importing Keras / zeromodels.
81
  - Prefer `Processor.from_weights(...)` so vision + tokenizer match.
82
  - 7B hybrid is a **different package** than 1.3B; do not mix imports.
83
+ - See [docs](https://imvision12.github.io/ZeroModels/deepseek_vl_hybrid/) and [Loading Weights](https://imvision12.github.io/ZeroModels/loading_weights/).
84
  - Community / upstream safetensors still work via the `hf:` prefix, e.g. `DeepseekVLHybridConditionalGenerate.from_weights("hf:deepseek-ai/deepseek-vl-7b-chat")`.
85
 
86
  ## Special Thanks
kf_config.json → zm_config.json RENAMED
@@ -1,7 +1,7 @@
1
  {
2
- "library_name": "kerasformers",
3
- "kerasformers_version": "1.2.1",
4
- "model_module": "kerasformers.models.deepseek_vl_hybrid",
5
  "model_class": "DeepseekVLHybridModel",
6
  "variant": "deepseek_vl_7b_chat",
7
  "weights": "model.weights.json",
 
1
  {
2
+ "library_name": "zeromodels",
3
+ "zeromodels_version": "1.2.1",
4
+ "model_module": "zeromodels.models.deepseek_vl_hybrid",
5
  "model_class": "DeepseekVLHybridModel",
6
  "variant": "deepseek_vl_7b_chat",
7
  "weights": "model.weights.json",
kf_preprocessor.json → zm_preprocessor.json RENAMED
@@ -1,41 +1,41 @@
1
- {
2
- "library_name": "kerasformers",
3
- "kerasformers_version": "1.1.3",
4
- "preprocessor_module": "kerasformers.models.deepseek_vl_hybrid",
5
- "preprocessor_class": "DeepseekVLHybridImageProcessor",
6
- "variant": "deepseek_vl_7b_chat",
7
- "size": 384,
8
- "high_res_size": 1024,
9
- "min_size": 14,
10
- "image_mean": [
11
- 0.5,
12
- 0.5,
13
- 0.5
14
- ],
15
- "image_std": [
16
- 0.5,
17
- 0.5,
18
- 0.5
19
- ],
20
- "high_res_image_mean": [
21
- 0.48145466,
22
- 0.4578275,
23
- 0.40821073
24
- ],
25
- "high_res_image_std": [
26
- 0.26862954,
27
- 0.26130258,
28
- 0.27577711
29
- ],
30
- "background_color": [
31
- 127,
32
- 127,
33
- 127
34
- ],
35
- "high_res_background_color": [
36
- 122,
37
- 116,
38
- 104
39
- ],
40
- "data_format": null
41
  }
 
1
+ {
2
+ "library_name": "zeromodels",
3
+ "zeromodels_version": "1.1.3",
4
+ "preprocessor_module": "zeromodels.models.deepseek_vl_hybrid",
5
+ "preprocessor_class": "DeepseekVLHybridImageProcessor",
6
+ "variant": "deepseek_vl_7b_chat",
7
+ "size": 384,
8
+ "high_res_size": 1024,
9
+ "min_size": 14,
10
+ "image_mean": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "image_std": [
16
+ 0.5,
17
+ 0.5,
18
+ 0.5
19
+ ],
20
+ "high_res_image_mean": [
21
+ 0.48145466,
22
+ 0.4578275,
23
+ 0.40821073
24
+ ],
25
+ "high_res_image_std": [
26
+ 0.26862954,
27
+ 0.26130258,
28
+ 0.27577711
29
+ ],
30
+ "background_color": [
31
+ 127,
32
+ 127,
33
+ 127
34
+ ],
35
+ "high_res_background_color": [
36
+ 122,
37
+ 116,
38
+ 104
39
+ ],
40
+ "data_format": null
41
  }