Upload folder using huggingface_hub
#1
by
sharpenb
- opened
- README.md +87 -0
- config.json +1 -0
- model/optimized_model.pkl +3 -0
- model/smash_config.json +1 -0
- plots.png +0 -0
README.md
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
[![Twitter](https://img.shields.io/twitter/follow/PrunaAI?style=social)](https://twitter.com/PrunaAI)
|
23 |
+
[![GitHub](https://img.shields.io/github/followers/PrunaAI?label=Follow%20%40PrunaAI&style=social)](https://github.com/PrunaAI)
|
24 |
+
[![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue)](https://www.linkedin.com/company/93832878/admin/feed/posts/?feedType=following)
|
25 |
+
[![Discord](https://img.shields.io/badge/Discord-Join%20Us-blue?style=social&logo=discord)](https://discord.gg/CP4VSgck)
|
26 |
+
|
27 |
+
# Simply make AI models cheaper, smaller, faster, and greener!
|
28 |
+
|
29 |
+
- Give a thumbs up if you like this model!
|
30 |
+
- Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
|
31 |
+
- Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
|
32 |
+
- Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
|
33 |
+
- Join Pruna AI community on Discord [here](https://discord.gg/CP4VSgck) to share feedback/suggestions or get help.
|
34 |
+
|
35 |
+
## Results
|
36 |
+
|
37 |
+
![image info](./plots.png)
|
38 |
+
|
39 |
+
**Important remarks:**
|
40 |
+
- The quality of the model output might slightly vary compared to the base model. There might be minimal quality loss.
|
41 |
+
- These results were obtained on NVIDIA A100-PCIE-40GB with configuration described in config.json and are obtained after a hardware warmup. Efficiency results may vary in other settings (e.g. other hardware, image size, batch size, ...).
|
42 |
+
- You can request premium access to more compression methods and tech support for your specific use-cases [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
|
43 |
+
|
44 |
+
## Setup
|
45 |
+
|
46 |
+
You can run the smashed model with these steps:
|
47 |
+
|
48 |
+
0. Check cuda, torch, packaging requirements are installed. For cuda, check with `nvcc --version` and install with `conda install nvidia/label/cuda-12.1.0::cuda`. For packaging and torch, run `pip install packaging torch`.
|
49 |
+
1. Install the `pruna-engine` available [here](https://pypi.org/project/pruna-engine/) on Pypi. It might take 15 minutes to install.
|
50 |
+
```bash
|
51 |
+
pip install pruna-engine[gpu] --extra-index-url https://pypi.nvidia.com --extra-index-url https://pypi.ngc.nvidia.com --extra-index-url https://prunaai.pythonanywhere.com/
|
52 |
+
```
|
53 |
+
3. Download the model files using one of these three options.
|
54 |
+
- Option 1 - Use command line interface (CLI):
|
55 |
+
```bash
|
56 |
+
mkdir SG161222-Realistic_Vision_V1.4-turbo-tiny-green-smashed
|
57 |
+
huggingface-cli download PrunaAI/SG161222-Realistic_Vision_V1.4-turbo-tiny-green-smashed --local-dir SG161222-Realistic_Vision_V1.4-turbo-tiny-green-smashed --local-dir-use-symlinks False
|
58 |
+
```
|
59 |
+
- Option 2 - Use Python:
|
60 |
+
```python
|
61 |
+
import subprocess
|
62 |
+
repo_name = "SG161222-Realistic_Vision_V1.4-turbo-tiny-green-smashed"
|
63 |
+
subprocess.run(["mkdir", repo_name])
|
64 |
+
subprocess.run(["huggingface-cli", "download", 'PrunaAI/'+ repo_name, "--local-dir", repo_name, "--local-dir-use-symlinks", "False"])
|
65 |
+
```
|
66 |
+
- Option 3 - Download them manually on the HuggingFace model page.
|
67 |
+
3. Load & run the model.
|
68 |
+
```python
|
69 |
+
from pruna_engine.PrunaModel import PrunaModel
|
70 |
+
|
71 |
+
model_path = "SG161222-Realistic_Vision_V1.4-turbo-tiny-green-smashed/model" # Specify the downloaded model path.
|
72 |
+
smashed_model = PrunaModel.load_model(model_path) # Load the model.
|
73 |
+
smashed_model(prompt='Beautiful fruits in trees', height=512, width=512)[0][0] # Run the model where x is the expected input of.
|
74 |
+
```
|
75 |
+
|
76 |
+
## Configurations
|
77 |
+
|
78 |
+
The configuration info are in `config.json`.
|
79 |
+
|
80 |
+
## Credits & License
|
81 |
+
|
82 |
+
We follow the same license as the original model. Please check the license of the original model SG161222/Realistic_Vision_V1.4 before using this model which provided the base model.
|
83 |
+
|
84 |
+
## Want to compress other models?
|
85 |
+
|
86 |
+
- Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
|
87 |
+
- 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": "None", "factorizers": "None", "quantizers": "None", "n_quantization_bits": 32, "output_deviation": 0.0, "compilers": "['step_caching', 'tiling', 'diffusers2']", "static_batch": true, "static_shape": false, "controlnet": "None", "unet_dim": 4, "device": "cuda", "batch_size": 1, "max_batch_size": 1, "image_height": 512, "image_width": 512, "version": "1.4", "task": "txt2img", "weight_name": "None", "model_name": "SG161222/Realistic_Vision_V1.4", "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:9b15bdac0521863ce2afdd76b111c22f820baa38715c32c8f0231a2433dbaf69
|
3 |
+
size 2743426061
|
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": "None", "factorizers": "None", "quantizers": "None", "n_quantization_bits": 32, "output_deviation": 0.0, "compilers": "['step_caching', 'tiling', 'diffusers2']", "static_batch": true, "static_shape": false, "controlnet": "None", "unet_dim": 4, "device": "cuda", "cache_dir": ".models/optimized_model", "batch_size": 1, "max_batch_size": 1, "image_height": 512, "image_width": 512, "version": "1.4", "task": "txt2img", "weight_name": "None", "model_name": "SG161222/Realistic_Vision_V1.4", "save_load_fn": "stable_fast"}}
|
plots.png
ADDED