Spaces:
Runtime error
Runtime error
File size: 573 Bytes
aa07dbb c7a0ce6 baba983 aa07dbb c7a0ce6 baba983 c7a0ce6 aa07dbb c7a0ce6 aa07dbb c7a0ce6 aa07dbb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
# Assuming you have a dictionary of pet names and their image URLs or file paths
pet_images = {
"David": "./david.jpg",
"Kikou": "./kikou.jpg",
# Add as many pets as you have
}
# Define your Gradio interface here
def your_function(pet_name):
# Handle the input and produce the image path or URL
image_path = pet_images.get(pet_name, "/david.jpg") # Default if pet not found
return image_path
# Create the interface
iface = gr.Interface(fn=your_function, inputs="text", outputs="image")
# Launch the interface
iface.launch()
|