Downloads · 30 days
0
0% of all-time downloads
NucleusAI/RetNet-1B-Hybrid-XATL
RetNet-1B-Hybrid-XATL is a machine learning model from NucleusAI. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a hybrid architecture between self-attention based Transformer and RetNet, where only the 2nd and middle layer is multi-head attention, and otherwise RetNet.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
2
Public
Repo size
8.6 GB
Likes
4
Public
Click a slice to open those files.
.md2 KB · 57%
From the Hugging Face model README
This is a hybrid architecture between self-attention based Transformer and RetNet, where only the 2nd and middle layer is multi-head attention, and otherwise RetNet.
This is the model weight accompanying the paper Cross-Architecture Transfer Learning for Linear-Cost Inference Transformers, in which new Linear-Cost Inference models (e.g. RetNet) are not trained from scratch but transfer shared weight components from other PTLMs. The model's input/output embeddings, MLP weights, & Layer Norms has been transferred from pythia-1B. For more detail, please refer to the paper.
Use the code below to get started with the model.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("NucleusAI/RetNet-1B-Hybrid-XATL", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("NucleusAI/RetNet-1B-Hybrid-XATL", trust_remote_code=True) # same as EleutherAI/pythia-1B
inputs = tokenizer("Hi there!", return_tensors="pt", return_attention_mask=False)
outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]
print(text)
The model has been trained with pile_dedup dataset, in favor of comparison with the same sized pythia models.