Skip to content

Commit d07f730

Browse files
patil-surajpcuenca
andauthored
Fix num images per prompt unclip (huggingface#1787)
* use repeat_interleave * fix repeat * Trigger Build * don't install accelerate from main * install released accelrate for mps test * Remove additional accelerate installation from main. Co-authored-by: Pedro Cuenca <[email protected]>
1 parent a6fb940 commit d07f730

File tree

4 files changed

+1
-7
lines changed

4 files changed

+1
-7
lines changed

.github/workflows/nightly_tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
- name: Install dependencies
6262
run: |
6363
python -m pip install -e .[quality,test]
64-
python -m pip install git+https://github.com/huggingface/accelerate
6564
python -m pip install -U git+https://github.com/huggingface/transformers
6665
6766
- name: Environment
@@ -135,7 +134,6 @@ jobs:
135134
${CONDA_RUN} python -m pip install --upgrade pip
136135
${CONDA_RUN} python -m pip install -e .[quality,test]
137136
${CONDA_RUN} python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
138-
${CONDA_RUN} python -m pip install git+https://github.com/huggingface/accelerate
139137
140138
- name: Environment
141139
shell: arch -arch arm64 bash {0}

.github/workflows/pr_tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
run: |
6060
apt-get update && apt-get install libsndfile1-dev -y
6161
python -m pip install -e .[quality,test]
62-
python -m pip install git+https://github.com/huggingface/accelerate
6362
python -m pip install -U git+https://github.com/huggingface/transformers
6463
6564
- name: Environment
@@ -127,7 +126,6 @@ jobs:
127126
${CONDA_RUN} python -m pip install --upgrade pip
128127
${CONDA_RUN} python -m pip install -e .[quality,test]
129128
${CONDA_RUN} python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
130-
${CONDA_RUN} python -m pip install git+https://github.com/huggingface/accelerate
131129
${CONDA_RUN} python -m pip install -U git+https://github.com/huggingface/transformers
132130
133131
- name: Environment

.github/workflows/push_tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
- name: Install dependencies
6262
run: |
6363
python -m pip install -e .[quality,test]
64-
python -m pip install git+https://github.com/huggingface/accelerate
6564
python -m pip install -U git+https://github.com/huggingface/transformers
6665
6766
- name: Environment
@@ -131,7 +130,6 @@ jobs:
131130
- name: Install dependencies
132131
run: |
133132
python -m pip install -e .[quality,test,training]
134-
python -m pip install git+https://github.com/huggingface/accelerate
135133
python -m pip install -U git+https://github.com/huggingface/transformers
136134
137135
- name: Environment

src/diffusers/pipelines/unclip/pipeline_unclip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def _encode_prompt(self, prompt, device, num_images_per_prompt, do_classifier_fr
173173
uncond_text_encoder_hidden_states = uncond_text_encoder_hidden_states.view(
174174
batch_size * num_images_per_prompt, seq_len, -1
175175
)
176-
uncond_text_mask = uncond_text_mask.repeat(1, num_images_per_prompt)
176+
uncond_text_mask = uncond_text_mask.repeat_interleave(num_images_per_prompt, dim=0)
177177

178178
# done duplicates
179179

0 commit comments

Comments
 (0)