sharpenb commited on
Commit
4c4a353
1 Parent(s): e69d35b

Upload folder using huggingface_hub (#1)

Browse files

- d3856367620d6fea19b5fa0a94e82ba05940734e662cf6a16b658c460abad2e1 (15700299c1b7a4ddd9d52150a77214f7858564c6)
- 6c4bad96cbeedc91ae664eea9d70e6c0184ad73045075882f7c963bc96c9c0f0 (6e9d8387439246f8c79c4eef7f4786ee6bb36c2e)

Files changed (5) hide show
  1. README.md +83 -0
  2. config.json +1 -0
  3. model/optimized_model.pkl +3 -0
  4. model/smash_config.json +1 -0
  5. plots.png +0 -0
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: pruna-engine
4
+ thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
5
+ metrics:
6
+ - memory_disk
7
+ - memory_inference
8
+ - inference_latency
9
+ - inference_throughput
10
+ - inference_CO2_emissions
11
+ - inference_energy_consumption
12
+ ---
13
+ <!-- header start -->
14
+ <!-- 200823 -->
15
+ <div style="width: auto; margin-left: auto; margin-right: auto">
16
+ <a href="https://www.pruna.ai/" target="_blank" rel="noopener noreferrer">
17
+ <img src="https://i.imgur.com/eDAlcgk.png" alt="PrunaAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
18
+ </a>
19
+ </div>
20
+ <!-- header end -->
21
+
22
+ # Simply make AI models cheaper, smaller, faster, and greener!
23
+
24
+ [![Twitter](https://img.shields.io/twitter/follow/PrunaAI?style=social)](https://twitter.com/PrunaAI)
25
+ [![GitHub](https://img.shields.io/github/followers/PrunaAI?label=Follow%20%40PrunaAI&style=social)](https://github.com/PrunaAI)
26
+ [![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue)](https://www.linkedin.com/company/93832878/admin/feed/posts/?feedType=following)
27
+
28
+ - Give a thumbs up if you like this model!
29
+ - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
30
+ - Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
31
+ - Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
32
+ - Share feedback and suggestions on the Slack of Pruna AI (Coming soon!).
33
+
34
+ ## Results
35
+
36
+ ![image info](./plots.png)
37
+
38
+ These results were obtained on NVIDIA A100-PCIE-40GB with configuration described in config.json. Results may vary in other settings (e.g. other hardware, image size, batch size, ...).
39
+
40
+ ## Setup
41
+
42
+ You can run the smashed model with these steps:
43
+
44
+ 0. Check that you have cuda installed. You can do this by running `nvcc --version` or `conda install nvidia/label/cuda-12.1.0::cuda`.
45
+ 1. Install the `pruna-engine` available [here](https://pypi.org/project/pruna-engine/) on Pypi. It might take 15 minutes to install.
46
+ ```bash
47
+ pip install pruna-engine[gpu] --extra-index-url https://pypi.nvidia.com --extra-index-url https://pypi.ngc.nvidia.com
48
+ ```
49
+ 3. Download the model files using one of these three options.
50
+ - Option 1 - Use command line interface (CLI):
51
+ ```bash
52
+ mkdir Linaqruf-animagine-xl-turbo-green-smashed
53
+ huggingface-cli download PrunaAI/Linaqruf-animagine-xl-turbo-green-smashed --local-dir Linaqruf-animagine-xl-turbo-green-smashed --local-dir-use-symlinks False
54
+ ```
55
+ - Option 2 - Use Python:
56
+ ```python
57
+ import subprocess
58
+ repo_name = "Linaqruf-animagine-xl-turbo-green-smashed"
59
+ subprocess.run(["mkdir", repo_name])
60
+ subprocess.run(["huggingface-cli", "download", 'PrunaAI/'+ repo_name, "--local-dir", repo_name, "--local-dir-use-symlinks", "False"])
61
+ ```
62
+ - Option 3 - Download them manually on the HuggingFace model page.
63
+ 3. Load & run the model.
64
+ ```python
65
+ from pruna_engine.PrunaModel import PrunaModel
66
+
67
+ model_path = "Linaqruf-animagine-xl-turbo-green-smashed/model" # Specify the downloaded model path.
68
+ smashed_model = PrunaModel.load_model(model_path) # Load the model.
69
+ smashed_model(prompt='Beautiful fruits in trees', height=1024, width=1024)[0][0] # Run the model where x is the expected input of.
70
+ ```
71
+
72
+ ## Configurations
73
+
74
+ The configuration info are in `config.json`.
75
+
76
+ ## License
77
+
78
+ We follow the same license as the original model. Please check the license of the original model ORIGINAL_Linaqruf-animagine-xl-turbo-green-smashed before using this model.
79
+
80
+ ## Want to compress other models?
81
+
82
+ - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
83
+ - Request access to easily compress your own AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"pruners": "None", "pruning_ratio": 0.0, "factorizers": "None", "quantizers": "None", "n_quantization_bits": 32, "output_deviation": 0.005, "compilers": "['diffusers2']", "static_batch": true, "static_shape": false, "controlnet": "None", "unet_dim": 4, "device": "cuda", "save_dir": "/ceph/hdd/staff/charpent/models/.models/optimized_model", "batch_size": 1, "max_batch_size": 1, "image_height": 1024, "image_width": 1024, "version": "xl-1.0", "scheduler": "DDIM", "task": "txt2imgxl", "model_name": "Linaqruf/animagine-xl", "weight_name": "None", "save_load_fn": "stable_fast"}
model/optimized_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e148ff090028499f0eff2abdcb78c2498db2ab6063a4374505663daa2ad52e7
3
+ size 6943131215
model/smash_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"api_key": "pruna_c4c77860c62a2965f6bc281841ee1d7bd3", "verify_url": "http://johnrachwan.pythonanywhere.com", "smash_config": {"pruners": "None", "pruning_ratio": 0.0, "factorizers": "None", "quantizers": "None", "n_quantization_bits": 32, "output_deviation": 0.005, "compilers": "['diffusers2']", "static_batch": true, "static_shape": false, "controlnet": "None", "unet_dim": 4, "device": "cuda", "cache_dir": "/ceph/hdd/staff/charpent/.cache/models", "save_dir": "/ceph/hdd/staff/charpent/models/.models/optimized_model", "batch_size": 1, "max_batch_size": 1, "image_height": 1024, "image_width": 1024, "version": "xl-1.0", "scheduler": "DDIM", "task": "txt2imgxl", "model_name": "Linaqruf/animagine-xl", "weight_name": "None", "save_load_fn": "stable_fast"}}
plots.png ADDED