mingyi456 commited on
Commit
b9da33b
·
verified ·
1 Parent(s): 7f7fd3d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -1
README.md CHANGED
@@ -13,8 +13,31 @@ pipeline_tag: text-to-image
13
 
14
  For more information (including how to compress models yourself), check out https://huggingface.co/DFloat11
15
 
16
- This is my first time using DF11 to compress a model outside the Flux architecture. The reason why it is much easier for me to compress Flux-based models is that
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  ### How to Use
20
 
 
13
 
14
  For more information (including how to compress models yourself), check out https://huggingface.co/DFloat11
15
 
16
+ This is my first time using DF11 to compress a model outside the Flux architecture. The reason why the process for compressing Flux-based models is much easier is because the compression code requires a `pattern_dict` as input, but the original [example code](https://github.com/LeanModels/DFloat11/tree/master/examples/compress_flux1) only provides the correct `pattern_dict` for Flux, which means I have to learn the notation myself and modify it to fit other models. After a long wait, the compressed model seems to work fine on my RTX 4090, but do let me know if you run into any problems.
17
 
18
+ The `pattern_dict` I used to compress this model is here:
19
+ ```python
20
+ pattern_dict={
21
+ "transformer_blocks\.\d+": (
22
+ "norm1.linear_1",
23
+ "norm1.linear_2",
24
+ "attn1.to_q",
25
+ "attn1.to_k",
26
+ "attn1.to_v",
27
+ "attn1.to_out.0",
28
+ "norm2.linear_1",
29
+ "norm2.linear_2",
30
+ "attn2.to_q",
31
+ "attn2.to_k",
32
+ "attn2.to_v",
33
+ "attn2.to_out.0",
34
+ "norm3.linear_1",
35
+ "norm3.linear_2",
36
+ "ff.net.0.proj",
37
+ "ff.net.2"
38
+ )
39
+ }
40
+ ```
41
 
42
  ### How to Use
43