File size: 606 Bytes
38aeeb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr

def greet_and_show_cat(name):
    # Greeting message
    greeting = f"Hello {name}!!"
    
    # URL of a cat image
    cat_image_url = "https://placekitten.com/400/400"
    
    # Return both the greeting and the cat image
    return greeting, cat_image_url

# Define the Gradio Interface
demo = gr.Interface(
    fn=greet_and_show_cat,  # Function that returns both greeting and cat image
    inputs="text",          # Input is a text field for the user to enter their name
    outputs=["text", "image"]  # Outputs include both text and image
)

# Launch the interface
demo.launch()