razanalsulami commited on
Commit
765aef1
·
verified ·
1 Parent(s): f96135a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  from PIL import Image
3
 
 
4
  animal_images = {
5
  "cat": "cat.jpg",
6
  "dog": "dog.jpg",
@@ -21,8 +22,8 @@ def fetch_animal_image(animal):
21
  # Define the Gradio Interface
22
  demo = gr.Interface(
23
  fn=fetch_animal_image,
24
- inputs=gr.inputs.Textbox(label="What's your favorite animal?"),
25
- outputs=gr.outputs.Image(type="pil"),
26
  title="Favorite Animal Image",
27
  description="Enter the name of your favorite animal and see an image of it."
28
  )
 
1
  import gradio as gr
2
  from PIL import Image
3
 
4
+ # Dictionary mapping animals to image file names in the root directory
5
  animal_images = {
6
  "cat": "cat.jpg",
7
  "dog": "dog.jpg",
 
22
  # Define the Gradio Interface
23
  demo = gr.Interface(
24
  fn=fetch_animal_image,
25
+ inputs=gr.Textbox(label="What's your favorite animal?"),
26
+ outputs=gr.Image(type="pil"),
27
  title="Favorite Animal Image",
28
  description="Enter the name of your favorite animal and see an image of it."
29
  )