Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
ajl2718
commited on
Commit
·
7316a14
1
Parent(s):
a03887d
Use whereabouts for geocoding
Browse files
app.py
CHANGED
@@ -1,10 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
|
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
10 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from whereabouts.utils import download
|
3 |
+
from whereabouts.Matcher import Matcher
|
4 |
|
5 |
+
# download the address database for all of Australia
|
6 |
+
download('au_all_sm', 'saunteringcat/whereabouts-db')
|
7 |
|
8 |
+
# create a matcher object
|
9 |
+
matcher = Matcher('au_all_sm')
|
10 |
+
|
11 |
+
def greet(address):
|
12 |
+
return matcher.geocode(address)
|
13 |
|
14 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
15 |
demo.launch()
|