Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
---
|
4 |
+
|
5 |
+
# Compressed LLM Model Zone
|
6 |
+
|
7 |
+
The models are prepared by [Visual Informatics Group @ University of Texas at Austin (VITA-group)](https://vita-group.github.io/).
|
8 |
+
|
9 |
+
License: [MIT License](https://opensource.org/license/mit/)
|
10 |
+
|
11 |
+
Setup environment
|
12 |
+
```shell
|
13 |
+
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
|
14 |
+
pip install transformers==4.31.0
|
15 |
+
pip install huggingface_hub accelerate
|
16 |
+
```
|
17 |
+
|
18 |
+
How to use
|
19 |
+
```python
|
20 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
21 |
+
base_model = 'llama-2-7b'
|
22 |
+
comp_degree = 0.1
|
23 |
+
comp_method = 'sparsegpt_unstructured'
|
24 |
+
model_path = f'vita-group/comp-{arch}_{comp_method}_s{comp_degree}'
|
25 |
+
model = AutoModelForCausalLM.from_pretrained(
|
26 |
+
model_path,
|
27 |
+
torch_dtype=torch.float16,
|
28 |
+
low_cpu_mem_usage=True,
|
29 |
+
device_map="auto"
|
30 |
+
)
|
31 |
+
tokenizer = AutoTokenizer.from_pretrained('meta-llama/Llama-2-7b')
|
32 |
+
input_ids = tokenizer('Hello! I am a VITA-compressed-LLM chatbot!', return_tensors='pt').input_ids
|
33 |
+
outputs = model.generate(input_ids)
|
34 |
+
```
|
35 |
+
|
36 |
+
|
37 |
+
| | Base Model | Model Size | Compression Method | Compression Degree |
|
38 |
+
|---:|:-------------|:-------------|:-----------------------|:--------------------------------------------------------------------------------------|
|
39 |
+
| 0 | Llama-2 | 7b | magnitude_unstructured | [s0.1](https://huggingface.co/vita-group/comp-llama-2-7b_magnitude_unstructured_s0.1) |
|
40 |
+
| 1 | Llama-2 | 7b | magnitude_unstructured | [s0.2](https://huggingface.co/vita-group/comp-llama-2-7b_magnitude_unstructured_s0.2) |
|
41 |
+
| 2 | Llama-2 | 7b | magnitude_unstructured | [s0.3](https://huggingface.co/vita-group/comp-llama-2-7b_magnitude_unstructured_s0.3) |
|
42 |
+
| 3 | Llama-2 | 7b | magnitude_unstructured | [s0.5](https://huggingface.co/vita-group/comp-llama-2-7b_magnitude_unstructured_s0.5) |
|
43 |
+
| 4 | Llama-2 | 7b | magnitude_unstructured | [s0.6](https://huggingface.co/vita-group/comp-llama-2-7b_magnitude_unstructured_s0.6) |
|
44 |
+
| 5 | Llama-2 | 7b | sparsegpt_unstructured | [s0.1](https://huggingface.co/vita-group/comp-llama-2-7b_sparsegpt_unstructured_s0.1) |
|
45 |
+
| 6 | Llama-2 | 7b | sparsegpt_unstructured | [s0.2](https://huggingface.co/vita-group/comp-llama-2-7b_sparsegpt_unstructured_s0.2) |
|
46 |
+
| 7 | Llama-2 | 7b | sparsegpt_unstructured | [s0.3](https://huggingface.co/vita-group/comp-llama-2-7b_sparsegpt_unstructured_s0.3) |
|
47 |
+
| 8 | Llama-2 | 7b | sparsegpt_unstructured | [s0.5](https://huggingface.co/vita-group/comp-llama-2-7b_sparsegpt_unstructured_s0.5) |
|
48 |
+
| 9 | Llama-2 | 7b | sparsegpt_unstructured | [s0.6](https://huggingface.co/vita-group/comp-llama-2-7b_sparsegpt_unstructured_s0.6) |
|
49 |
+
| 10 | Llama-2 | 7b | wanda_unstructured | [s0.1](https://huggingface.co/vita-group/comp-llama-2-7b_wanda_unstructured_s0.1) |
|
50 |
+
| 11 | Llama-2 | 7b | wanda_unstructured | [s0.2](https://huggingface.co/vita-group/comp-llama-2-7b_wanda_unstructured_s0.2) |
|
51 |
+
| 12 | Llama-2 | 7b | wanda_unstructured | [s0.3](https://huggingface.co/vita-group/comp-llama-2-7b_wanda_unstructured_s0.3) |
|
52 |
+
| 13 | Llama-2 | 7b | wanda_unstructured | [s0.5](https://huggingface.co/vita-group/comp-llama-2-7b_wanda_unstructured_s0.5) |
|
53 |
+
| 14 | Llama-2 | 7b | wanda_unstructured | [s0.6](https://huggingface.co/vita-group/comp-llama-2-7b_wanda_unstructured_s0.6) |
|
54 |
+
|