Downloads · 30 days
172
10% of all-time downloads
heegyu/llama-small-randomweights
llama-small-randomweights is a text generation model from heegyu. Use it when you need the model to write or continue text. It is set up for transformers.
This is 82M parameters llama model of random weights. This model can be use for proof of concept. <br/ Tokenizer is copy of meta-llama/Llama-2-7b
Downloads · 30 days
172
10% of all-time downloads
All-time downloads
1.7K
Public
Repo size
348 MB
Likes
1
Public
Click a slice to open those files.
.bin174 MB · 100%
From the Hugging Face model README
This is 82M parameters llama model of random weights. This model can be use for proof of concept. <br/> Tokenizer is copy of meta-llama/Llama-2-7b
# Use a pipeline as a high-level helper
from transformers import LlamaConfig, LlamaForCausalLM, LlamaTokenizer
import numpy as np
config = LlamaConfig(vocab_size=32000, hidden_size=768, intermediate_size=768*4, num_hidden_layers=4, num_attention_heads=8)
tokenizer = LlamaTokenizer.from_pretrained("meta-llama/Llama-2-7b")
model = LlamaForCausalLM(config).half()
model_parameters = filter(lambda p: p.requires_grad, model.parameters())
params = sum([np.prod(p.size()) for p in model_parameters])
print(params / 1024 / 1024) # 82.881591796875
hub_id = "heegyu/llama-small-randomweights"
tokenizer.push_to_hub(hub_id)
model.push_to_hub(hub_id)