Simple, minimal implementation of the Mamba SSM in one file of PyTorch.
Python
2,970
18 commits
updated Mar 8, 2024
Simple, minimal implementation of Mamba in one file of PyTorch.
Featuring:
Does NOT include:
See demo.ipynb for examples of prompt completions.
from model import Mamba
from transformers import AutoTokenizer
model = Mamba.from_pretrained('state-spaces/mamba-370m')
tokenizer = AutoTokenizer.from_pretrained('EleutherAI/gpt-neox-20b')
generate(model, tokenizer, 'Mamba is the')
Mamba is the world's longest venomous snake with an estimated length of over 150 m. With such a large size and a venomous bite, Mamba kills by stabbing the victim (which is more painful and less effective than a single stab of the bite)
150 meters... 🫢 scary!
The Mamba architecture was introduced in Mamba: Linear-Time Sequence Modeling with Selective State Spaces by Albert Gu and Tri Dao.
The official implementation is here: https://github.com/state-spaces/mamba/tree/main
6,113 followers · starred Feb 2024
2,123 followers · starred Mar 2024
1,398 followers · starred Jun 2024
77 followers · starred Dec 2023
Python
67.6%
Jupyter Notebook
32.4%
Simple, minimal implementation of the Mamba SSM in one file of PyTorch.
Python
2,970
18 commits
updated Mar 8, 2024
Simple, minimal implementation of Mamba in one file of PyTorch.
Featuring:
Does NOT include:
See demo.ipynb for examples of prompt completions.
from model import Mamba
from transformers import AutoTokenizer
model = Mamba.from_pretrained('state-spaces/mamba-370m')
tokenizer = AutoTokenizer.from_pretrained('EleutherAI/gpt-neox-20b')
generate(model, tokenizer, 'Mamba is the')
Mamba is the world's longest venomous snake with an estimated length of over 150 m. With such a large size and a venomous bite, Mamba kills by stabbing the victim (which is more painful and less effective than a single stab of the bite)
150 meters... 🫢 scary!
The Mamba architecture was introduced in Mamba: Linear-Time Sequence Modeling with Selective State Spaces by Albert Gu and Tri Dao.
The official implementation is here: https://github.com/state-spaces/mamba/tree/main
6,113 followers · starred Feb 2024
2,123 followers · starred Mar 2024
1,398 followers · starred Jun 2024
77 followers · starred Dec 2023
Python
67.6%
Jupyter Notebook
32.4%