johnrachwanpruna
commited on
Commit
•
d846c4b
1
Parent(s):
5351395
Update README.md
Browse files
README.md
CHANGED
@@ -27,24 +27,23 @@ metrics:
|
|
27 |
|
28 |
## Setup
|
29 |
|
30 |
-
You can run the smashed model
|
31 |
-
1. Installing and importing the `pruna-engine` (version 0.2.
|
32 |
-
2. Downloading the model files
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
34 |
4. Running the model.
|
35 |
-
|
36 |
-
The model is smashed for 1024x1024 image size. Contact us if you want a version with dynamic size support.
|
37 |
-
|
38 |
You can achieve this by running the following code:
|
39 |
|
40 |
```python
|
41 |
-
from transformers.utils.hub import cached_file
|
42 |
from pruna_engine.PrunaModel import PrunaModel # Step (1): install and import `pruna-engine` package.
|
43 |
-
|
44 |
-
...
|
45 |
-
model_path = cached_file("PrunaAI/segmind-SSD-1B-smashed", "model") # Step (2): download the model files at `model_path`.
|
46 |
smashed_model = PrunaModel.load_model(model_path) # Step (3): load the model.
|
47 |
-
y = smashed_model(prompt="
|
48 |
```
|
49 |
|
50 |
## Configurations
|
|
|
27 |
|
28 |
## Setup
|
29 |
|
30 |
+
You can run the smashed model by:
|
31 |
+
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.
|
32 |
+
2. Downloading the model files. This can be done using the Hugging Face CLI with the following commands:
|
33 |
+
```bash
|
34 |
+
mkdir CompVis-stable-diffusion-v1-4-smashed
|
35 |
+
huggingface-cli download PrunaAI/segmind-SSD-1B-smashed --local-dir segmind-SSD-1B-smashed --local-dir-use-symlinks False
|
36 |
+
```
|
37 |
+
Alternatively, you can download them manually.
|
38 |
+
3. Loading the model.
|
39 |
4. Running the model.
|
|
|
|
|
|
|
40 |
You can achieve this by running the following code:
|
41 |
|
42 |
```python
|
|
|
43 |
from pruna_engine.PrunaModel import PrunaModel # Step (1): install and import `pruna-engine` package.
|
44 |
+
model_path = "segmind-SSD-1B-smashed/model" # Step (2): specify the downloaded model path.
|
|
|
|
|
45 |
smashed_model = PrunaModel.load_model(model_path) # Step (3): load the model.
|
46 |
+
y = smashed_model(prompt="an astronaut riding a horse on mars", image_height=1024, image_width=1024)[0] # Step (4): run the model.
|
47 |
```
|
48 |
|
49 |
## Configurations
|