File size: 2,510 Bytes
95b3067
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d846c4b
 
 
 
 
09969b3
d846c4b
 
 
5351395
cadc11b
95b3067
 
 
09969b3
95b3067
d846c4b
95b3067
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
license: apache-2.0
library_name: pruna-engine
thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
metrics:
- memory_disk
- memory_inference
- inference_latency
- inference_throughput
- inference_CO2_emissions
- inference_energy_consumption
---
<!-- header start -->
<!-- 200823 -->
<div style="width: auto; margin-left: auto; margin-right: auto">
    <a href="https://www.pruna.ai/" target="_blank" rel="noopener noreferrer">
        <img src="https://i.imgur.com/eDAlcgk.png" alt="PrunaAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
    </a>
</div>
<!-- header end -->

# Simply make AI models cheaper, smaller, faster, and greener!

## Results

![image info](./plots.png)

## Setup

You can run the smashed model by:
1. Installing and importing the `pruna-engine` (version 0.2.9) package. Use `pip install pruna-engine==0.2.9 --extra-index-url https://pypi.nvidia.com --extra-index-url https://pypi.ngc.nvidia.com` for installation. See [Pypi](https://pypi.org/project/pruna-engine/) for details on the package.
2. Downloading the model files. This can be done using the Hugging Face CLI with the following commands:
    ```bash
    mkdir CompVis-stable-diffusion-v1-4-smashed
    huggingface-cli download PrunaAI/segmind-SSD-1B-turbo-tiny-green-smashed --local-dir segmind-SSD-1B-turbo-tiny-green-smashed --local-dir-use-symlinks False
    ```
   Alternatively, you can download them manually.
3. Loading the model.
4. Running the model.
You can achieve this by running the following code:

```python
from pruna_engine.PrunaModel import PrunaModel  # Step (1): install and import `pruna-engine` package.
model_path = "segmind-SSD-1B-turbo-tiny-green-smashed/model" # Step (2): specify the downloaded model path.
smashed_model = PrunaModel.load_model(model_path)  # Step (3): load the model.
y = smashed_model(prompt="an astronaut riding a horse on mars", image_height=1024, image_width=1024)[0]  # Step (4): run the model.
```

## Configurations

The configuration info are in `config.json`.

## License

We follow the same license as the original model. Please check the license of the original model before using this model.

## Want to compress other models?

- Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
- Request access to easily compress your own AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).