BerenMillidge commited on
Commit
1017c26
·
verified ·
1 Parent(s): 3a0bcbe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +84 -3
README.md CHANGED
@@ -1,3 +1,84 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - Zyphra/ZAYA1-base
5
+ pipeline_tag: image-text-to-text
6
+ ---
7
+
8
+ # ZAYA1-8B-VL
9
+
10
+
11
+
12
+
13
+ ## Performance
14
+
15
+ ZAYA1-8B-VL performs extremely strongly against models of a comparable size and inference flops including outperforming several strong larger models.
16
+
17
+ ![scores_vs_params-1](https://cdn-uploads.huggingface.co/production/uploads/65c05e75c084467acab2f84a/ivOwANwAmAzFDsa-JveP6.png)
18
+
19
+ ### Key Capabilities:
20
+
21
+ * **Strong OCR and Document Understanding**: Excels at reading and understanding complex documents
22
+
23
+ * **Powerful Gruonding and Spatial Perception**: Possesses strong grounding and bounding-box capabilities especially for high-resolution images.
24
+
25
+ * **Multimodal Reasoning**: Capable of powerful and detailed mathematical and scientific reasoning about images.
26
+
27
+ * **GUI and Computer-Use**: Highly proficient at reading websites and phone apps, pointing to correct buttons, and general computer use interactions.
28
+
29
+
30
+ ### Model Architecture
31
+
32
+ ZAYA1-8B-VL builds upon and uses our [ZAYA1-7B LLM](https://huggingface.co/Zyphra/ZAYA1-base) as its base text encoder. We also use the [Qwen2.5-VL vision encoder](https://huggingface.co/docs/transformers/model_doc/qwen2_5_vl) for the ViT. ZAYA1-8B-VL introduces two novel architectural innovations:
33
+
34
+ * **Vision-specific LoRA parameters**: ZAYA1-8B-VL utilizes specialized LoRA parameters on its MLPs and CCA weights which are only activated on vision tokens. We find that adding vision-specific parameters substantially improves model performance since the model has the option to devote specific parameters solely to visual processing. We train these LoRA parameters alongside the main model parameters during training.
35
+
36
+ * **Bidirectional Attention for image tokens**: ZAYA1-8B-VL processes all image token inputs with a bidirectional attention mask, meaning attention is not causal across an image. We find that this improves performance by not imposing an arbitrary causal order to image tokens which are naturally non-causal.
37
+
38
+
39
+ ![smoe_vl_arch-1](https://cdn-uploads.huggingface.co/production/uploads/65c05e75c084467acab2f84a/wFuVyNIAzcaehBG1RiMjg.png)
40
+
41
+ ZAYA1-8B-VL is trained only upon open data. Detailed dataset descriptions can be found in the accompanying technical report.
42
+
43
+ ## Quick start
44
+
45
+ ### Prerequisites
46
+
47
+ TODO
48
+
49
+ To use ZAYA1, install `zaya` branch from our fork of `transformers` library, which is based on the v4.57.1 of `transformers`:
50
+ ```bash
51
+ pip install "transformers @ git+https://github.com/Zyphra/transformers.git@zaya"
52
+ ```
53
+
54
+ The command above relies on requirements for `transformers v4.57.1` being installed in your environment. If you're installing in a fresh Python environment, you might want to specify a specific extra, like `[dev-torch]`, to install all the dependencies:
55
+ ```bash
56
+ pip install "transformers[dev-torch] @ git+https://github.com/Zyphra/transformers.git@zaya"
57
+ ```
58
+
59
+
60
+ ### Inference
61
+
62
+ TODO
63
+
64
+ ```python
65
+ from transformers import AutoTokenizer, AutoModelForCausalLM
66
+ import torch
67
+
68
+ tokenizer = AutoTokenizer.from_pretrained("Zyphra/ZAYA1-base")
69
+ model = AutoModelForCausalLM.from_pretrained("Zyphra/ZAYA1-base", device_map="cuda", dtype=torch.bfloat16)
70
+
71
+ input_text = "What factors contributed to the fall of the Roman Empire?"
72
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
73
+
74
+ outputs = model.generate(**input_ids, max_new_tokens=100)
75
+ print(tokenizer.decode(outputs[0]))
76
+ ```
77
+
78
+ ### Citation
79
+
80
+ If you find our work helpful, feel free to give us a cite.
81
+
82
+ ```
83
+ TODO
84
+ ```