Any-to-Any
bagel
custom_code
kuvvi commited on
Commit
fa0c6a3
·
verified ·
1 Parent(s): 3e18431

Dataset card organized by task

Browse files
Files changed (1) hide show
  1. README.md +94 -2
README.md CHANGED
@@ -1,10 +1,102 @@
1
  ---
2
  license: apache-2.0
3
- base_model: ByteDance-Seed/BAGEL-7B-MoT
 
4
  pipeline_tag: any-to-any
5
  library_name: bagel
 
 
 
 
 
6
  ---
7
 
8
  # ThinkMorph-SSL-Instruct
9
 
10
- Model weights. More details will be added later.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ base_model: ThinkMorph/ThinkMorph-SSL-Base
4
+ base_model_relation: finetune
5
  pipeline_tag: any-to-any
6
  library_name: bagel
7
+ language:
8
+ - en
9
+ datasets:
10
+ - ThinkMorph/Pretext-270K
11
+ - ThinkMorph/Instruct-180K
12
  ---
13
 
14
  # ThinkMorph-SSL-Instruct
15
 
16
+ ThinkMorph-SSL-Instruct is a unified multimodal model that reasons with interleaved text and
17
+ images. On a visual question, it writes reasoning text, generates intermediate images such as a
18
+ zoomed-in crop, a depth map, a bird's-eye view or the view from another position, and then
19
+ gives the answer.
20
+
21
+ It is built on [BAGEL-7B-MoT](https://huggingface.co/ByteDance-Seed/BAGEL-7B-MoT) in two stages:
22
+
23
+ 1. **Self-supervised pretext reasoning** on [Pretext-270K](https://huggingface.co/datasets/ThinkMorph/Pretext-270K): the
24
+ model restores corrupted images and describes them before and after. This stage gives
25
+ [ThinkMorph-SSL-Base](https://huggingface.co/ThinkMorph/ThinkMorph-SSL-Base).
26
+ 2. **Instruction tuning** on [Instruct-180K](https://huggingface.co/datasets/ThinkMorph/Instruct-180K): question-driven
27
+ traces whose intermediate images come from 17 visual operations.
28
+
29
+ This repository holds the EMA weights at step 5,500 of the second stage.
30
+
31
+ ## Prompt format
32
+
33
+ The model was trained with the system prompt below. Use it at inference:
34
+
35
+ ```text
36
+ Use <think>...</think> for intermediate reasoning or planning.
37
+
38
+ To generate an image, write <gen_image> followed by an image-size declaration:
39
+ <gen_image>[Image size: (height, width)]
40
+ Generated images become part of your context and can inform subsequent reasoning. You may generate more than one image if needed.
41
+
42
+ If the task requires a final textual answer, wrap it in <answer>...</answer>.
43
+ If no textual answer is needed, the response may end after reasoning or image generation.
44
+
45
+ Example:
46
+ <think>reasoning step</think>
47
+ <gen_image>[Image size: (512, 512)]
48
+ <think>observe and reason about the generated image</think>
49
+ <answer>final answer</answer>
50
+ ```
51
+
52
+ When the model writes `<gen_image>[Image size: (height, width)]`, the inference loop generates
53
+ an image with the model's image branch, adds it to the context and continues decoding.
54
+
55
+ ## Loading
56
+
57
+ The repository has the same layout as BAGEL-7B-MoT, so the official BAGEL inference code
58
+ (<https://github.com/ByteDance-Seed/Bagel>) loads it: point `model_path` at a local copy.
59
+
60
+ ```bash
61
+ hf download ThinkMorph/ThinkMorph-SSL-Instruct --local-dir ThinkMorph-SSL-Instruct
62
+ ```
63
+
64
+ Keep the VAE and the tokenizer files shipped here. The VAE is the one used in training, and
65
+ the tokenizer has the special tokens the model was trained with.
66
+
67
+ ## Files
68
+
69
+ | File | Content |
70
+ | --- | --- |
71
+ | `ema.safetensors` | the model weights: bfloat16, 14.7B parameters (29.4 GB) |
72
+ | `ae.safetensors` | the VAE, frozen during training |
73
+ | `config.json`, `llm_config.json`, `vit_config.json`, `generation_config.json` | model configuration |
74
+ | `vocab.json`, `merges.txt`, `added_tokens.json`, `special_tokens_map.json`, `tokenizer_config.json` | the tokenizer, with the special tokens used in training |
75
+
76
+ ## Training
77
+
78
+ | | Stage 1: pretext reasoning | Stage 2: instruction tuning |
79
+ | --- | --- | --- |
80
+ | Starts from | BAGEL-7B-MoT | ThinkMorph-SSL-Base |
81
+ | Data | Pretext-270K, 270,896 training traces | Instruct-180K, 180,490 traces |
82
+ | GPUs | 32 | 48 |
83
+ | Learning rate, warmup | 2.83e-5, 1,000 steps | 2e-5, 1,000 steps |
84
+ | Sequence packing | up to 16,384 tokens | up to 20,480 tokens |
85
+ | Released weights | EMA at step 5,500 | EMA at step 5,500 (this repository) |
86
+
87
+ Both stages train on next-token cross-entropy for text and flow matching for generated images,
88
+ with weight 1 each. The VAE is frozen; the language model and the vision encoder are trained.
89
+ EMA weights are kept in fp32 with decay 0.9998 from step 1,000.
90
+
91
+ ## Evaluation
92
+
93
+ Results will be added with the paper.
94
+
95
+ ## License
96
+
97
+ The weights are released under Apache-2.0, following BAGEL-7B-MoT. The training data keep
98
+ the terms of their image sources; see the dataset cards.
99
+
100
+ ## Citation
101
+
102
+ The citation will be added with the paper.