Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
f13c68c
1
Parent(s):
106ce34
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ from pathlib import Path
|
|
18 |
import spaces
|
19 |
import zipfile
|
20 |
|
21 |
-
MAX_IMAGES =
|
22 |
|
23 |
training_script_url = "https://raw.githubusercontent.com/huggingface/diffusers/main/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py"
|
24 |
subprocess.run(['wget', '-N', training_script_url])
|
@@ -85,6 +85,10 @@ num_images_settings = {
|
|
85 |
|
86 |
def load_captioning(uploaded_images, option):
|
87 |
updates = []
|
|
|
|
|
|
|
|
|
88 |
if len(uploaded_images) > MAX_IMAGES:
|
89 |
raise gr.Error(
|
90 |
f"Error: for now, only {MAX_IMAGES} or less images are allowed for training"
|
|
|
18 |
import spaces
|
19 |
import zipfile
|
20 |
|
21 |
+
MAX_IMAGES = 100
|
22 |
|
23 |
training_script_url = "https://raw.githubusercontent.com/huggingface/diffusers/main/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py"
|
24 |
subprocess.run(['wget', '-N', training_script_url])
|
|
|
85 |
|
86 |
def load_captioning(uploaded_images, option):
|
87 |
updates = []
|
88 |
+
if len(uploaded_images <= 1):
|
89 |
+
raise gr.Error(
|
90 |
+
"Error: please upload at least 2 images to train your model (the ideal number with default settings is between 4-30)"
|
91 |
+
)
|
92 |
if len(uploaded_images) > MAX_IMAGES:
|
93 |
raise gr.Error(
|
94 |
f"Error: for now, only {MAX_IMAGES} or less images are allowed for training"
|