File size: 502 Bytes
6f1ab54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()