Spaces:
Paused
Paused
Anton Forsman
commited on
Commit
·
e133530
1
Parent(s):
604cd2a
fix percentage
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ from inference import inference
|
|
4 |
import torch
|
5 |
import io
|
6 |
from diffusion import DiffusionImageAPI
|
|
|
7 |
|
8 |
def main():
|
9 |
|
@@ -50,7 +51,7 @@ def main():
|
|
50 |
img_buffer.seek(0)
|
51 |
|
52 |
# Update the content of the placeholders
|
53 |
-
progress_placeholder.write(f"Generating Image...\nProgress: {(progress * 100):.2f}%")
|
54 |
image_placeholder.image(img_buffer, caption='Generated Image', width=300)
|
55 |
|
56 |
inference(cond, callback=callback)
|
|
|
4 |
import torch
|
5 |
import io
|
6 |
from diffusion import DiffusionImageAPI
|
7 |
+
import math
|
8 |
|
9 |
def main():
|
10 |
|
|
|
51 |
img_buffer.seek(0)
|
52 |
|
53 |
# Update the content of the placeholders
|
54 |
+
progress_placeholder.write(f"Generating Image...\nProgress: {min(progress * 110, 100):.2f}%")
|
55 |
image_placeholder.image(img_buffer, caption='Generated Image', width=300)
|
56 |
|
57 |
inference(cond, callback=callback)
|