---
base_model: GeneZC/MiniChat-2-3B
inference: True
model_type: Llama
---
# MiniChat-2-3B
This repo contains pruned model files for [MiniChat-2-3B](https://huggingface.co/GeneZC/MiniChat-2-3B).
This model was pruned with [SparseGPT](https://arxiv.org/abs/2301.00774), using [SparseML](https://github.com/neuralmagic/sparseml).
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
prompt = "How to make banana bread?"
formatted_prompt = f" [|User|]\n{prompt}[|Assistant|]\n"
model_id = "nm-testing/MiniChat-2-3B-pruned50-24"
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.float16)
tokenizer = AutoTokenizer.from_pretrained(model_id)
inputs = tokenizer(formatted_prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.batch_decode(outputs)[0])
"""
[|User|]
How to make banana bread?[|Assistant|]
To make banana bread, follow these steps:
1. Start by preparing the ingredients. You will need banana bread mix, flour, water, and salt.
2. Mix the ingredients together and mix the mixture thoroughly.
3. Pour the mixture into a pan to cook.
4. Cook the mixture until it is cooked.
5. Once the bread is cooked, you can use it as a base for making banana bread.
6. Add the banana bread mix to the pan and mix it thoroughly.
7. Pour the mixture into a pan to cook.
8. Cook the mixture until it is cooked.
9. Once the bread is cooked, you can use it as a base for making banana bread.
10. Add the banana bread mix to the pan and mix it thoroughly.
11. Pour the mixture into a pan to cook.
12.
"""
```