Downloads · 30 days
23
5% of all-time downloads
ivanzhouyq/levanter-backpack-1b-100k
levanter-backpack-1b-100k is a text generation model from ivanzhouyq. 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.
Please install transformers, safetensors and torch to use this model.
Downloads · 30 days
23
5% of all-time downloads
All-time downloads
478
Public
Parameters
1.4B
5.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.7 GB · 100%
From the Hugging Face model README
Please install transformers, safetensors and torch to use this model.
pip install transformers safetensors torch
Run the following Python code:
import torch
import transformers
from transformers import AutoModelForCausalLM
model_id = "ivanzhouyq/levanter-backpack-1b-100k"
config = transformers.AutoConfig.from_pretrained(model_id, trust_remote_code=True)
torch_model = AutoModelForCausalLM.from_pretrained(
model_id,
config=config,
trust_remote_code=True
)
torch_model.eval()
input = torch.randint(0, 50264, (1, 512), dtype=torch.long)
torch_out = torch_model(input, position_ids=None,)
torch_out = torch.nn.functional.softmax(torch_out.logits, dim=-1)
print(torch_out.shape)