import gradio as gr from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="my-custom-user-agent") def geocoding(address): location = geolocator.geocode(address) return location.latitude, location.longitude # Create a Gradio interface iface = gr.Interface( fn=geocoding, # Specify your custom function inputs="text", # Input type (text in this example) outputs="text" # Output type (text in this example) ) # Launch the Gradio interface iface.launch()