EmilyWitko HF staff commited on
Commit
c576123
1 Parent(s): 1ff7175

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -8,6 +8,11 @@ owner_pets = {
8
  # Add more owners and their pets as needed
9
  }
10
 
 
 
 
 
 
11
  # Define your function
12
  def your_function(owner_name, pet_name=None):
13
  pets = owner_pets.get(owner_name)
@@ -24,7 +29,9 @@ def your_function(owner_name, pet_name=None):
24
 
25
  # Define your Gradio interface
26
  def your_gradio_function(owner_name):
 
27
  image_path = your_function(owner_name)
 
28
  return image_path
29
 
30
  # Create the interface
 
8
  # Add more owners and their pets as needed
9
  }
10
 
11
+ import os
12
+ for owner, owned_pets in owner_pets.items():
13
+ for pet, img_path in owned_pets.items():
14
+ assert os.path.isfile(img_path), f"File '{img_path}' does not exist."
15
+
16
  # Define your function
17
  def your_function(owner_name, pet_name=None):
18
  pets = owner_pets.get(owner_name)
 
29
 
30
  # Define your Gradio interface
31
  def your_gradio_function(owner_name):
32
+ print(f"Received owner name: {owner_name}")
33
  image_path = your_function(owner_name)
34
+ print(f"Returned image path: {image_path}")
35
  return image_path
36
 
37
  # Create the interface