import gradio as gr # URLs of the images urls = [ "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main/verb-tense-1.png", "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main/verb-tense-2.png", "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main/verb-tense-3.png", "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main/verb-tense-4.png" ] # Function to get the selected image URL def get_image(sid): nid = int(sid) - 1 return urls[nid] # Create a Gradio interface with gr.Blocks() as demo: sid_input = gr.Radio(choices=["1", "2", "3", "4"], label="Select Image") image_output = gr.Image() sid_input.change(fn=get_image, inputs=sid_input, outputs=image_output) demo.launch()