johnrachwanpruna commited on
Commit
77508ae
1 Parent(s): a843803

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -7
README.md CHANGED
@@ -29,19 +29,23 @@ Above results for 768x768 image size with 4-step inference on A100. Dynamic imag
29
  ## Setup
30
 
31
  You can run the smashed model by:
32
- 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 detailed on the package.
33
- 2. Downloading the model files at `model_path`. This can be done using huggingface with this repository name or with manual downloading.
34
- 3. Loading the model
35
- 4. Running the model.
 
 
 
 
 
36
 
37
  You can achieve this by running the following code:
38
 
39
  ```python
40
- from transformers.utils.hub import cached_file
41
  from pruna_engine.PrunaModel import PrunaModel # Step (1): install and import `pruna-engine` package.
42
 
43
- model_path = cached_file("PrunaAI/SimianLuo-LCM_Dreamshaper_v7-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
  smashed_model("Self-portrait oil painting, a beautiful cyborg with golden hair, 8k", num_inference_steps=4)[0] # Step (4): run the model.
46
  ```
47
 
 
29
  ## Setup
30
 
31
  You can run the smashed model by:
32
+ 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.
33
+ 2. Downloading the model files. This can be done using the Hugging Face CLI with the following commands:
34
+ ```bash
35
+ mkdir SimianLuo-LCM_Dreamshaper_v7-smashed
36
+ huggingface-cli download SimianLuo-LCM_Dreamshaper_v7-smashed --local-dir PrunaAI/SimianLuo-LCM_Dreamshaper_v7-smashed --local-dir-use-symlinks False
37
+ ```
38
+ Alternatively, you can download them manually.
39
+ 3. Loading the model.
40
+ 4. Running the model.
41
 
42
  You can achieve this by running the following code:
43
 
44
  ```python
 
45
  from pruna_engine.PrunaModel import PrunaModel # Step (1): install and import `pruna-engine` package.
46
 
47
+ model_path = "PrunaAI/SimianLuo-LCM_Dreamshaper_v7-smashed" # Step (2): specify the downloaded model path.
48
+ smashed_model = PrunaModel.load_model('SimianLuo-LCM_Dreamshaper_v7-smashed/model') # Step (3): load the model.
49
  smashed_model("Self-portrait oil painting, a beautiful cyborg with golden hair, 8k", num_inference_steps=4)[0] # Step (4): run the model.
50
  ```
51