retnet/README.md
To install:
pip install torchscale
Alternatively, you can develop it locally:
git clone https://github.com/microsoft/torchscale.git
cd torchscale
pip install -e .
It takes only several lines of code to create a RetNet model:
# Creating a RetNet model
>>> import torch
>>> from torchscale.architecture.config import RetNetConfig
>>> from torchscale.architecture.retnet import RetNetDecoder
>>> config = RetNetConfig(vocab_size=64000)
>>> retnet = RetNetDecoder(config)
>>> print(retnet)
--subln or --deepnorm should not be added.If you find this repository useful, please consider citing our work:
@article{retnet,
author={Yutao Sun and Li Dong and Shaohan Huang and Shuming Ma and Yuqing Xia and Jilong Xue and Jianyong Wang and Furu Wei},
title = {Retentive Network: A Successor to {Transformer} for Large Language Models},
journal = {ArXiv},
volume = {abs/2307.08621},
year = {2023}
}