MMCA - Pytorch
Project description
Multi-Modal Causal Attention
The open source community's implementation of the all-new Multi-Modal Causal Attention from "DeepSpeed-VisualChat: Multi-Round Multi-Image Interleave Chat via Multi-Modal Causal Attention"
Appreciation
- Lucidrains
- Agorians
Install
pip install mmca
Usage
import torch
from mmca.main import MultiModalCausalAttention
attn = MultiModalCausalAttention(dim=512, heads=8)
x = torch.randn(1, 10, 512)
y = torch.randn(1, 20, 512)
#create a mask for the text
# mask = torch.ones(1, 20).bool()
x, y = attn(x, y)
print(x)
# print(y)
Architecture
Todo
License
MIT
Citations
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mmca-0.0.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
mmca-0.0.2-py3-none-any.whl
(3.3 kB
view hashes)