Skip to content

Commit

Permalink
fix: Panic when running with dev profile
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksenger committed Jan 1, 2025
1 parent f0384fa commit c003ab2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions candle-transformers/src/models/stable_diffusion/uni_pc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ impl EdmDpmMultistepScheduler {

let (mut rks, mut d1s) = (vec![], vec![]);
for i in 1..self.state.order() {
let ti = self.timestep(step_index - (i + 1));
let ti = self.timestep(step_index.saturating_sub(i + 1));
let Some(mi) = model_outputs
.get(model_outputs.len() - (i + 1))
.get(model_outputs.len().saturating_sub(i + 1))
.into_iter()
.flatten()
.next()
Expand Down Expand Up @@ -513,9 +513,9 @@ impl EdmDpmMultistepScheduler {

let (mut rks, mut d1s) = (vec![], vec![]);
for i in 1..self.state.order() {
let ti = self.timestep(step_index - (i + 1));
let ti = self.timestep(step_index.saturating_sub(i + 1));
let Some(mi) = model_outputs
.get(model_outputs.len() - (i + 1))
.get(model_outputs.len().saturating_sub(i + 1))
.into_iter()
.flatten()
.next()
Expand Down

0 comments on commit c003ab2

Please sign in to comment.