PetsatHF / app.py
EmilyWitko's picture
EmilyWitko HF staff
Update app.py
b6fb37b verified
raw
history blame
661 Bytes
import gradio as gr
# Assuming you have a dictionary of pet names and their image URLs or file paths
pet_images = {
"David": "Users/EmilyWitko/desktop/David/david.jpg",
"Kikou": "Users/EmilyWitko/desktop/David/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, "Users/EmilyWitko/desktop/David/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()