multimodalart HF staff commited on
Commit
f13c68c
1 Parent(s): 106ce34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -18,7 +18,7 @@ from pathlib import Path
18
  import spaces
19
  import zipfile
20
 
21
- MAX_IMAGES = 500
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"