johnrachwanpruna
commited on
Commit
•
6550ade
1
Parent(s):
50c771a
Update README.md
Browse files
README.md
CHANGED
@@ -27,20 +27,20 @@ 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 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
36 |
You can achieve this by running the following code:
|
37 |
-
|
38 |
```python
|
39 |
-
from transformers.utils.hub import cached_file
|
40 |
from pruna_engine.PrunaModel import PrunaModel # Step (1): install and import `pruna-engine` package.
|
41 |
-
|
42 |
-
...
|
43 |
-
model_path = cached_file("PrunaAI/runwayml-stable-diffusion-v1-5-smashed", "model") # Step (2): download the model files at `model_path`.
|
44 |
smashed_model = PrunaModel.load_model(model_path) # Step (3): load the model.
|
45 |
y = smashed_model(prompt="a silly prune with a face in high definition", image_height=512, image_width=512)[0] # Step (4): run the model.
|
46 |
```
|
|
|
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 --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 runwayml-stable-diffusion-v1-5-smashed
|
35 |
+
huggingface-cli download PrunaAI/runwayml-stable-diffusion-v1-5-smashed --local-dir runwayml-stable-diffusion-v1-5-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 |
```python
|
|
|
42 |
from pruna_engine.PrunaModel import PrunaModel # Step (1): install and import `pruna-engine` package.
|
43 |
+
model_path = "runwayml-stable-diffusion-v1-5-smashed/model" # Step (2): specify the downloaded model path.
|
|
|
|
|
44 |
smashed_model = PrunaModel.load_model(model_path) # Step (3): load the model.
|
45 |
y = smashed_model(prompt="a silly prune with a face in high definition", image_height=512, image_width=512)[0] # Step (4): run the model.
|
46 |
```
|