Spaces:
Running
Running
ndhieunguyen
commited on
Commit
•
22c5f0f
1
Parent(s):
dfe8f6f
fix: oor
Browse files
src/improved_diffusion/gaussian_diffusion.py
CHANGED
@@ -679,6 +679,7 @@ class GaussianDiffusion:
|
|
679 |
caption[1].to(img.device),
|
680 |
) # (caption_state, caption_mask)
|
681 |
my_bar = st.progress(0, text="Processing")
|
|
|
682 |
for pro, i in enumerate(indices):
|
683 |
t = torch.tensor([i] * shape[0], device=device)
|
684 |
with torch.no_grad():
|
@@ -694,7 +695,7 @@ class GaussianDiffusion:
|
|
694 |
)
|
695 |
yield out
|
696 |
img = out["sample"]
|
697 |
-
my_bar.progress(pro, text="Processing")
|
698 |
my_bar.empty()
|
699 |
|
700 |
def p_sample_loop_langevin_progressive(
|
|
|
679 |
caption[1].to(img.device),
|
680 |
) # (caption_state, caption_mask)
|
681 |
my_bar = st.progress(0, text="Processing")
|
682 |
+
max_pro = len(indices)
|
683 |
for pro, i in enumerate(indices):
|
684 |
t = torch.tensor([i] * shape[0], device=device)
|
685 |
with torch.no_grad():
|
|
|
695 |
)
|
696 |
yield out
|
697 |
img = out["sample"]
|
698 |
+
my_bar.progress((pro + 1) / max_pro, text="Processing")
|
699 |
my_bar.empty()
|
700 |
|
701 |
def p_sample_loop_langevin_progressive(
|