Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
---
|
4 |
+
|
5 |
+
# dummy-llama-2
|
6 |
+
|
7 |
+
This is a dummy version of the model based on [`meta-llama/Llama-2-7b-hf`](https://huggingface.co/meta-llama/Llama-2-7b-hf).
|
8 |
+
|
9 |
+
## 🧩 Dummy
|
10 |
+
|
11 |
+
`dummy-llama-2` has a size of 886.03 MB instead of the original 12852.65 MB (compression factor of 14.51) but keeps the base model's functionality.
|
12 |
+
|
13 |
+
The purpose of this dummy version is to be used for **debugging**, so you don't have to download the entire original model. Do not use it for inference.
|
14 |
+
|
15 |
+
## 💻 Usage
|
16 |
+
|
17 |
+
```python
|
18 |
+
# pip install transformers accelerate
|
19 |
+
|
20 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
21 |
+
import torch
|
22 |
+
|
23 |
+
model = "dummy-llama-2"
|
24 |
+
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
26 |
+
model = AutoModelForCausalLM.from_pretrained(
|
27 |
+
model,
|
28 |
+
low_cpu_mem_usage=True,
|
29 |
+
return_dict=True,
|
30 |
+
torch_dtype=torch.float16,
|
31 |
+
device_map={"": 0},
|
32 |
+
)
|
33 |
+
```
|