Dataset card organized by task
Browse files
README.md
CHANGED
|
@@ -1,10 +1,98 @@
|
|
| 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-Base
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: ByteDance-Seed/BAGEL-7B-MoT
|
| 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 |
---
|
| 12 |
|
| 13 |
# ThinkMorph-SSL-Base
|
| 14 |
|
| 15 |
+
ThinkMorph-SSL-Base is [BAGEL-7B-MoT](https://huggingface.co/ByteDance-Seed/BAGEL-7B-MoT) after self-supervised pretext
|
| 16 |
+
reasoning on [Pretext-270K](https://huggingface.co/datasets/ThinkMorph/Pretext-270K). Each training trace starts from
|
| 17 |
+
a corrupted image: grayscale, noisy, low-resolution, masked, warped, rotated or flipped, or cut
|
| 18 |
+
into shuffled tiles. The model describes the input, generates the restored image, and describes
|
| 19 |
+
the result.
|
| 20 |
+
|
| 21 |
+
This repository holds the EMA weights at step 5,500.
|
| 22 |
+
[ThinkMorph-SSL-Instruct](https://huggingface.co/ThinkMorph/ThinkMorph-SSL-Instruct) is trained from these weights.
|
| 23 |
+
|
| 24 |
+
The model has seen no questions or answers in training. Use it as a starting point for further
|
| 25 |
+
training. For visual question answering, use ThinkMorph-SSL-Instruct.
|
| 26 |
+
|
| 27 |
+
## Prompt format
|
| 28 |
+
|
| 29 |
+
The model was trained with the system prompt below. Use it at inference:
|
| 30 |
+
|
| 31 |
+
```text
|
| 32 |
+
Use <think>...</think> for intermediate reasoning or planning.
|
| 33 |
+
|
| 34 |
+
To generate an image, write <gen_image> followed by an image-size declaration:
|
| 35 |
+
<gen_image>[Image size: (height, width)]
|
| 36 |
+
Generated images become part of your context and can inform subsequent reasoning. You may generate more than one image if needed.
|
| 37 |
+
|
| 38 |
+
If the task requires a final textual answer, wrap it in <answer>...</answer>.
|
| 39 |
+
If no textual answer is needed, the response may end after reasoning or image generation.
|
| 40 |
+
|
| 41 |
+
Example:
|
| 42 |
+
<think>reasoning step</think>
|
| 43 |
+
<gen_image>[Image size: (512, 512)]
|
| 44 |
+
<think>observe and reason about the generated image</think>
|
| 45 |
+
<answer>final answer</answer>
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
When the model writes `<gen_image>[Image size: (height, width)]`, the inference loop generates
|
| 49 |
+
an image with the model's image branch, adds it to the context and continues decoding.
|
| 50 |
+
|
| 51 |
+
## Loading
|
| 52 |
+
|
| 53 |
+
The repository has the same layout as BAGEL-7B-MoT, so the official BAGEL inference code
|
| 54 |
+
(<https://github.com/ByteDance-Seed/Bagel>) loads it: point `model_path` at a local copy.
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
hf download ThinkMorph/ThinkMorph-SSL-Base --local-dir ThinkMorph-SSL-Base
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Keep the VAE and the tokenizer files shipped here. The VAE is the one used in training, and
|
| 61 |
+
the tokenizer has the special tokens the model was trained with.
|
| 62 |
+
|
| 63 |
+
## Files
|
| 64 |
+
|
| 65 |
+
| File | Content |
|
| 66 |
+
| --- | --- |
|
| 67 |
+
| `ema.safetensors` | the model weights: bfloat16, 14.7B parameters (29.4 GB) |
|
| 68 |
+
| `ae.safetensors` | the VAE, frozen during training |
|
| 69 |
+
| `config.json`, `llm_config.json`, `vit_config.json`, `generation_config.json` | model configuration |
|
| 70 |
+
| `vocab.json`, `merges.txt`, `added_tokens.json`, `special_tokens_map.json`, `tokenizer_config.json` | the tokenizer, with the special tokens used in training |
|
| 71 |
+
|
| 72 |
+
All files except `ema.safetensors` are identical to those of ThinkMorph-SSL-Instruct. The EMA
|
| 73 |
+
state of the training checkpoint was merged and cast to bfloat16 in the same layout (1,451
|
| 74 |
+
tensors). The unused last SigLIP layer is left out, as in BAGEL.
|
| 75 |
+
|
| 76 |
+
## Training
|
| 77 |
+
|
| 78 |
+
| | Stage 1: pretext reasoning |
|
| 79 |
+
| --- | --- |
|
| 80 |
+
| Starts from | BAGEL-7B-MoT |
|
| 81 |
+
| Data | Pretext-270K, 270,896 training traces |
|
| 82 |
+
| GPUs | 32 |
|
| 83 |
+
| Learning rate, warmup | 2.83e-5, 1,000 steps |
|
| 84 |
+
| Sequence packing | up to 16,384 tokens |
|
| 85 |
+
| Released weights | EMA at step 5,500 |
|
| 86 |
+
|
| 87 |
+
Training uses 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 |
+
## License
|
| 92 |
+
|
| 93 |
+
The weights are released under Apache-2.0, following BAGEL-7B-MoT. The training data keep
|
| 94 |
+
the terms of their image sources; see the dataset card.
|
| 95 |
+
|
| 96 |
+
## Citation
|
| 97 |
+
|
| 98 |
+
The citation will be added with the paper.
|