Downloads · 30 days
33
8% of all-time downloads
mgoin/tiny-random-LlamaForCausalLM-pruned95-compressed
tiny-random-LlamaForCausalLM-pruned95-compressed is a text generation model from mgoin. Use it when you need the model to write or continue text. It is set up for transformers.
https://huggingface.co/HuggingFaceM4/tiny-random-LlamaForCausalLM
Downloads · 30 days
33
8% of all-time downloads
All-time downloads
393
Public
Parameters
1.2M
8 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.7 MB · 54%
How the weights are stored.
F161M · 84%
From the Hugging Face model README
https://huggingface.co/HuggingFaceM4/tiny-random-LlamaForCausalLM
from sparseml.transformers import SparseAutoModelForCausalLM, SparseAutoTokenizer, oneshot
from sparseml.modifiers import SparseGPTModifier
model_id = "HuggingFaceM4/tiny-random-LlamaForCausalLM"
compressed_model_id = "mgoin/tiny-random-LlamaForCausalLM-pruned95-compressed"
# Apply SparseGPT to the model
oneshot(
model=model_id,
dataset="open_platypus",
recipe=SparseGPTModifier(sparsity=0.95),
output_dir="temp-output",
)
model = SparseAutoModelForCausalLM.from_pretrained("temp-output", torch_dtype="auto")
tokenizer = SparseAutoTokenizer.from_pretrained(model_id)
model.save_pretrained(compressed_model_id.split("/")[-1], save_compressed=True)
tokenizer.save_pretrained(compressed_model_id.split("/")[-1])
# Upload the checkpoint to Hugging Face
from huggingface_hub import HfApi
HfApi().upload_folder(
folder_path=compressed_model_id.split("/")[-1],
repo_id=compressed_model_id,
)