martingenzel lbourdois commited on
Commit
a89fd7f
Β·
verified Β·
1 Parent(s): eac9241

Improve language tag (#1)

Browse files

- Improve language tag (0da932bd1be64f91b1ea1ea027ca0b3cae42227b)


Co-authored-by: LoΓ―ck BOURDOIS <[email protected]>

Files changed (1) hide show
  1. README.md +104 -92
README.md CHANGED
@@ -1,92 +1,104 @@
1
- ---
2
- license: apache-2.0
3
- datasets:
4
- - allenai/c4
5
- language:
6
- - en
7
- metrics:
8
- - perplexity
9
- - accuracy
10
- base_model:
11
- - Qwen/Qwen2.5-7B
12
- pipeline_tag: text-generation
13
- library_name: transformers
14
- ---
15
- <div align="center">
16
- <img width="30%" alt="logo" src="https://imgur.com/A0MCHPq.png">
17
- </div>
18
-
19
- <div align="center">
20
- <a href="https://github.com/merantix-momentum/acip"><img src="https://img.shields.io/badge/GitHub-%23121011.svg?logo=github&logoColor=white.svg" alt="github" style="display: inline-block; vertical-align: middle;"></a>
21
- <a href="https://arxiv.org/abs/2502.01717"><img src="https://img.shields.io/badge/arXiv-2502.01717-b31b1b.svg" alt="arxiv" style="display: inline-block; vertical-align: middle;"></a>
22
- <a href="https://acip.merantix-momentum.com/"><img alt="website" src="https://img.shields.io/website/https/acip.merantix-momentum.com.svg?down_color=red&down_message=offline&up_message=online" style="display: inline-block; vertical-align: middle;"></a>
23
- </div>
24
-
25
- <h2 align="center">
26
- <p> [
27
- <a href="https://github.com/merantix-momentum/acip">πŸ€– GitHub</a> |
28
- <a href="https://arxiv.org/abs/2502.01717">πŸ“„ Paper</a> |
29
- <a href="https://acip.merantix-momentum.com/">🌐 Website</a>
30
- ]
31
- </p>
32
- </h2>
33
-
34
- <h1 align="center">
35
- <p>ACIP applied to Qwen/Qwen2.5-7B</p>
36
- </h1>
37
-
38
- This model repository is part of the ACIP Project and provides a compressible version of [`Qwen/Qwen2.5-7B`](https://huggingface.co/Qwen/Qwen2.5-7B). For more details, please visit our [code repo](https://github.com/merantix-momentum/acip).
39
-
40
- # Quick Start
41
-
42
- Just load the ACIP model via `from_pretrained`:
43
- ```python
44
- from transformers import AutoModel
45
-
46
- model = AutoModel.from_pretrained("MerantixMomentum/acip_qwen25_7b", trust_remote_code=True)
47
- ```
48
- This will download and create a fully parameterized ACIP model that can be pruned to any compression ratio you wish.
49
- For example,
50
- ```python
51
- model.prune_model_by_score(compression_ratio=0.4)
52
- ```
53
- will prune `model` to 40% if its original size measured in number of parameters, i.e., 60% compression rate.
54
- A unique feature of ACIP is that this operation is revertible in the sense that you can rerun `model.prune_model_by_score` as often as you like to evaluate your model at different sizes. Finally, you can "commit" to a certain ratio and run
55
- ```python
56
- model.compress()
57
- ```
58
- which will discard all pruned mask values of compressible linear layers.
59
- Now the model is actually compressed and you should observe a significant decrease of memory usage (this step is not revertible without reloading the ACIP model).
60
- If you like, you can also run
61
- ```python
62
- model.quantize()
63
- ```
64
- to save even more memory (we have only tested 4bit quantization with `bitsandbytes`, but you could also customize this).
65
-
66
- **πŸš€ That's it! You can now use your compressed model for inference or fine-tuning as any other Causal Language Model from πŸ€— transformers.**
67
-
68
- **Note**: The parameter `compression_ratio` ranges from 1.0 to 0.0, indicating the model size after compression. For example, 0.4 means that the model has only 40% of the original number of parameters and 1.0 means no compression at all.
69
-
70
- # Dependencies
71
-
72
- To run an ACIP model from our hub, you only need minimal dependencies, namely `torch`, `transformers`, `peft`, and optionally, `bitsandbytes` in case you want to quantize your model.
73
- See [requirements.txt](requirements.txt) for pip-installable dependencies with exact version pins (newer version should work as well).
74
-
75
- # License
76
-
77
- This model is released under the apache-2.0 license.
78
-
79
- # Citation
80
-
81
- When using or referring to this model, please cite our [paper](https://arxiv.org/abs/2502.01717):
82
- ```bibtex
83
- @article{mxm2025acip,
84
- title={Choose Your Model Size: Any Compression by a Single Gradient Descent},
85
- author={M. Genzel, P. Putzky, P. Zhao, S. Schulze, M. Mollenhauer, R. Seidel, S. Dietzel, T. Wollmann},
86
- year={2025},
87
- journal={Preprint arXiv:2502.01717}
88
- }
89
- ```
90
-
91
-
92
-
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - allenai/c4
5
+ language:
6
+ - zho
7
+ - eng
8
+ - fra
9
+ - spa
10
+ - por
11
+ - deu
12
+ - ita
13
+ - rus
14
+ - jpn
15
+ - kor
16
+ - vie
17
+ - tha
18
+ - ara
19
+ metrics:
20
+ - perplexity
21
+ - accuracy
22
+ base_model:
23
+ - Qwen/Qwen2.5-7B
24
+ pipeline_tag: text-generation
25
+ library_name: transformers
26
+ ---
27
+ <div align="center">
28
+ <img width="30%" alt="logo" src="https://imgur.com/A0MCHPq.png">
29
+ </div>
30
+
31
+ <div align="center">
32
+ <a href="https://github.com/merantix-momentum/acip"><img src="https://img.shields.io/badge/GitHub-%23121011.svg?logo=github&logoColor=white.svg" alt="github" style="display: inline-block; vertical-align: middle;"></a>
33
+ <a href="https://arxiv.org/abs/2502.01717"><img src="https://img.shields.io/badge/arXiv-2502.01717-b31b1b.svg" alt="arxiv" style="display: inline-block; vertical-align: middle;"></a>
34
+ <a href="https://acip.merantix-momentum.com/"><img alt="website" src="https://img.shields.io/website/https/acip.merantix-momentum.com.svg?down_color=red&down_message=offline&up_message=online" style="display: inline-block; vertical-align: middle;"></a>
35
+ </div>
36
+
37
+ <h2 align="center">
38
+ <p> [
39
+ <a href="https://github.com/merantix-momentum/acip">πŸ€– GitHub</a> |
40
+ <a href="https://arxiv.org/abs/2502.01717">πŸ“„ Paper</a> |
41
+ <a href="https://acip.merantix-momentum.com/">🌐 Website</a>
42
+ ]
43
+ </p>
44
+ </h2>
45
+
46
+ <h1 align="center">
47
+ <p>ACIP applied to Qwen/Qwen2.5-7B</p>
48
+ </h1>
49
+
50
+ This model repository is part of the ACIP Project and provides a compressible version of [`Qwen/Qwen2.5-7B`](https://huggingface.co/Qwen/Qwen2.5-7B). For more details, please visit our [code repo](https://github.com/merantix-momentum/acip).
51
+
52
+ # Quick Start
53
+
54
+ Just load the ACIP model via `from_pretrained`:
55
+ ```python
56
+ from transformers import AutoModel
57
+
58
+ model = AutoModel.from_pretrained("MerantixMomentum/acip_qwen25_7b", trust_remote_code=True)
59
+ ```
60
+ This will download and create a fully parameterized ACIP model that can be pruned to any compression ratio you wish.
61
+ For example,
62
+ ```python
63
+ model.prune_model_by_score(compression_ratio=0.4)
64
+ ```
65
+ will prune `model` to 40% if its original size measured in number of parameters, i.e., 60% compression rate.
66
+ A unique feature of ACIP is that this operation is revertible in the sense that you can rerun `model.prune_model_by_score` as often as you like to evaluate your model at different sizes. Finally, you can "commit" to a certain ratio and run
67
+ ```python
68
+ model.compress()
69
+ ```
70
+ which will discard all pruned mask values of compressible linear layers.
71
+ Now the model is actually compressed and you should observe a significant decrease of memory usage (this step is not revertible without reloading the ACIP model).
72
+ If you like, you can also run
73
+ ```python
74
+ model.quantize()
75
+ ```
76
+ to save even more memory (we have only tested 4bit quantization with `bitsandbytes`, but you could also customize this).
77
+
78
+ **πŸš€ That's it! You can now use your compressed model for inference or fine-tuning as any other Causal Language Model from πŸ€— transformers.**
79
+
80
+ **Note**: The parameter `compression_ratio` ranges from 1.0 to 0.0, indicating the model size after compression. For example, 0.4 means that the model has only 40% of the original number of parameters and 1.0 means no compression at all.
81
+
82
+ # Dependencies
83
+
84
+ To run an ACIP model from our hub, you only need minimal dependencies, namely `torch`, `transformers`, `peft`, and optionally, `bitsandbytes` in case you want to quantize your model.
85
+ See [requirements.txt](requirements.txt) for pip-installable dependencies with exact version pins (newer version should work as well).
86
+
87
+ # License
88
+
89
+ This model is released under the apache-2.0 license.
90
+
91
+ # Citation
92
+
93
+ When using or referring to this model, please cite our [paper](https://arxiv.org/abs/2502.01717):
94
+ ```bibtex
95
+ @article{mxm2025acip,
96
+ title={Choose Your Model Size: Any Compression by a Single Gradient Descent},
97
+ author={M. Genzel, P. Putzky, P. Zhao, S. Schulze, M. Mollenhauer, R. Seidel, S. Dietzel, T. Wollmann},
98
+ year={2025},
99
+ journal={Preprint arXiv:2502.01717}
100
+ }
101
+ ```
102
+
103
+
104
+