Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import traceback
|
|
10 |
|
11 |
# Constants
|
12 |
IMG_SIZE = 128
|
13 |
-
TIMESTEPS =
|
14 |
NUM_CLASSES = 2
|
15 |
|
16 |
# Global Cancellation Flag
|
@@ -231,7 +231,7 @@ def load_model(model_path, device):
|
|
231 |
|
232 |
diffusion_model.eval()
|
233 |
return diffusion_model
|
234 |
-
|
235 |
MODEL_NAME = "model_weights.pth"
|
236 |
model_path = MODEL_NAME
|
237 |
print("Loading model...")
|
@@ -299,7 +299,7 @@ def generate_images(label_str, num_images, progress=gr.Progress()):
|
|
299 |
raise gr.Error(f"Generation failed: {str(e)}")
|
300 |
finally:
|
301 |
torch.cuda.empty_cache()
|
302 |
-
|
303 |
# Gradio UI
|
304 |
with gr.Blocks(theme=gr.themes.Soft(
|
305 |
primary_hue="violet",
|
|
|
10 |
|
11 |
# Constants
|
12 |
IMG_SIZE = 128
|
13 |
+
TIMESTEPS = 500
|
14 |
NUM_CLASSES = 2
|
15 |
|
16 |
# Global Cancellation Flag
|
|
|
231 |
|
232 |
diffusion_model.eval()
|
233 |
return diffusion_model
|
234 |
+
|
235 |
MODEL_NAME = "model_weights.pth"
|
236 |
model_path = MODEL_NAME
|
237 |
print("Loading model...")
|
|
|
299 |
raise gr.Error(f"Generation failed: {str(e)}")
|
300 |
finally:
|
301 |
torch.cuda.empty_cache()
|
302 |
+
|
303 |
# Gradio UI
|
304 |
with gr.Blocks(theme=gr.themes.Soft(
|
305 |
primary_hue="violet",
|