simonduerr commited on
Commit
2e2af5c
·
verified ·
1 Parent(s): 69b80eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -39,7 +39,9 @@ if not os.path.exists(model):
39
  @spaces.GPU(duration=120)
40
  def predict(jobname, inputs, recycling_steps, sampling_steps, diffusion_samples):
41
  jobname = re.sub(r'[<>:"/\\|?*]', '_', jobname)
42
- os.makedirs(jobname)
 
 
43
  """format Gradio Component:
44
  # {"chains": [
45
  # {
 
39
  @spaces.GPU(duration=120)
40
  def predict(jobname, inputs, recycling_steps, sampling_steps, diffusion_samples):
41
  jobname = re.sub(r'[<>:"/\\|?*]', '_', jobname)
42
+ if jobname == "":
43
+ raise gr.Error("Job name empty or only invalid characters. Choose a plaintext name.")
44
+ os.makedirs(jobname, exist_ok=True)
45
  """format Gradio Component:
46
  # {"chains": [
47
  # {