Downloads · 30 days
36
2% of all-time downloads
NucleusAI/RetNet-410m-XATL
RetNet-410m-XATL is a text generation model from NucleusAI. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is a RetNet model, accompanying the paper Cross-Architecture Transfer Learning for Linear-Cost Inference Transformers, In this work, we proposed to not train new Linear-Cost Inference models (e.g. RetNet) from sc…
Downloads · 30 days
36
2% of all-time downloads
All-time downloads
1.9K
Public
Repo size
3.4 GB
Likes
3
Public
Click a slice to open those files.
.bin1.7 GB · 100%
From the Hugging Face model README
This is a RetNet model, accompanying the paper Cross-Architecture Transfer Learning for Linear-Cost Inference Transformers, In this work, we proposed to not train new Linear-Cost Inference models (e.g. RetNet) from scratch, but to transfer shared weight components from other PTLMs. The model's input/output embeddings, MLP weights, Layer Norms, Attention Output Projections ($W_O$) has been transferred from pythia-410m. 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-410m-XATL", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("NucleusAI/RetNet-410m-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.