Fuyu
A implementation of Fuyu, the multimodal AI model from Adept in pytorch and zeta. The architecture is basically instead of using an encoder like VIT or CLIP they just patch the image then project it then feed it into the transformer decoder. The architecture is image patch embeddings -> linear projection -> decoder llm.
UPDATE
-
Fuyu-Heavy: proposes that scaling up the model architecture works but with some caveats. They need more stabilization during training. I have refactored the base Fuyu model implementation to include RMSNorm, LayerNorm, Swish, and a vast array of other techniques to radically increase multi-modal training such as normalizing the image during the shape rearrange and after.
-
DPO Confirmed HERE
Appreciation
- Lucidrains
- Agorians
- Adept
Install
pip install fuyu
Usage
import torch
from fuyu import Fuyu
# Initialize model
model = Fuyu(
num_tokens=20342,
max_seq_len=4092,
dim=640,
depth=8,
dim_head=128,
heads=6,
use_abs_pos_emb=False,
alibi_pos_bias=True,
alibi_num_heads=3,
rotary_xpos=True,
attn_flash=True,
attn_kv_heads=2,
qk_norm=False,
attn_qk_norm=False,
attn_qk_norm_dim_scale=False,
patches=16,
)
# Text shape: [batch, seq_len, dim]
text = torch.randint(0, 20342, (1, 4092))
# Img shape: [batch, channels, height, width]
img = torch.randn(1, 3, 256, 256)
# Apply model to text and img
y = model(text, img)
# Output shape: [batch, seq_len, dim]
print(y)
License
MIT
Citations
Metadata
Release files for fuyu 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fuyu-0.0.7.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fuyu-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.8 kB
Release files / fuyu-0.0.7.tar.gz
| Download URL | fuyu-0.0.7.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f0d88f177c3a5dd82ccd3d168c5b55281f43271a8cf28ad2421ca14d821a6c3
|
|
BLAKE2b-256 checksum How to use checksums |
38e471cee6a877f111d10debf974eaf7c685bbb42ac6a2fbeab7854c03a59d26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0
|
Release files / fuyu-0.0.7-py3-none-any.whl
| Download URL | fuyu-0.0.7-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e75c4cfde28c95ed09a1692d6d4755457630db252508a49162eae92e5811d289
|
|
BLAKE2b-256 checksum How to use checksums |
9c97dcab3b6be748133e5d502029cea70ea3b88992b7bac7025b8d3e9087a007
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0
|