Spaces:
Sleeping
Sleeping
Commit
·
8f5ea1d
1
Parent(s):
0097c9c
Update screens/predict.py
Browse files- screens/predict.py +4 -8
screens/predict.py
CHANGED
@@ -3,7 +3,6 @@ import json
|
|
3 |
from autogluon.multimodal import MultiModalPredictor
|
4 |
from autogluon.tabular import TabularPredictor
|
5 |
import pandas as pd
|
6 |
-
from geopy.geocoders import GoogleV3
|
7 |
import os
|
8 |
import tempfile
|
9 |
|
@@ -16,10 +15,8 @@ def predict_page():
|
|
16 |
|
17 |
# Load geocoder and model based on user role
|
18 |
@st.cache(allow_output_mutation=True)
|
19 |
-
def load_geocoder():
|
20 |
-
return GoogleV3(api_key=os.environ.get("GOOGLE_MAP_API_KEY"))
|
21 |
|
22 |
-
|
23 |
if user_role == "Buyer":
|
24 |
model_path = "models/mm-nlp-image-transformer/"
|
25 |
else:
|
@@ -72,10 +69,9 @@ def predict_page():
|
|
72 |
title = ""
|
73 |
|
74 |
# Calculate latitude and longitude
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
longitude = geocode_result.longitude
|
79 |
|
80 |
# Display location map
|
81 |
st.map([(latitude, longitude)], zoom=15)
|
|
|
3 |
from autogluon.multimodal import MultiModalPredictor
|
4 |
from autogluon.tabular import TabularPredictor
|
5 |
import pandas as pd
|
|
|
6 |
import os
|
7 |
import tempfile
|
8 |
|
|
|
15 |
|
16 |
# Load geocoder and model based on user role
|
17 |
@st.cache(allow_output_mutation=True)
|
|
|
|
|
18 |
|
19 |
+
|
20 |
if user_role == "Buyer":
|
21 |
model_path = "models/mm-nlp-image-transformer/"
|
22 |
else:
|
|
|
69 |
title = ""
|
70 |
|
71 |
# Calculate latitude and longitude
|
72 |
+
|
73 |
+
latitude = float("nan")
|
74 |
+
longitude = float("nan")
|
|
|
75 |
|
76 |
# Display location map
|
77 |
st.map([(latitude, longitude)], zoom=15)
|