Spaces:
Sleeping
Sleeping
Georges
commited on
Commit
·
171690e
1
Parent(s):
444065d
fix env
Browse files- src/app.py +0 -7
src/app.py
CHANGED
|
@@ -29,8 +29,6 @@ def text_description_to_locations(description: str) -> list[str]:
|
|
| 29 |
|
| 30 |
text = text.strip()
|
| 31 |
|
| 32 |
-
# return ["Paris, France", "Rome, Italy", "Barcelona, Spain", "Amsterdam, Netherlands"]
|
| 33 |
-
|
| 34 |
locations = [loc.strip() for loc in text.split(",")]
|
| 35 |
|
| 36 |
return locations
|
|
@@ -48,14 +46,9 @@ def search_location(location_name) -> Optional[dict[str, float]]:
|
|
| 48 |
"q": location_name,
|
| 49 |
"format": "json"
|
| 50 |
}
|
| 51 |
-
st.write(os.environ.get("pk_key"))
|
| 52 |
response = requests.get(url, params=params, headers=headers)
|
| 53 |
|
| 54 |
-
st.write("DEBUG:")
|
| 55 |
-
st.write(str(response))
|
| 56 |
-
|
| 57 |
response_json = response.json()
|
| 58 |
-
#st.write(response)
|
| 59 |
location = response_json[0]
|
| 60 |
if not location:
|
| 61 |
return None
|
|
|
|
| 29 |
|
| 30 |
text = text.strip()
|
| 31 |
|
|
|
|
|
|
|
| 32 |
locations = [loc.strip() for loc in text.split(",")]
|
| 33 |
|
| 34 |
return locations
|
|
|
|
| 46 |
"q": location_name,
|
| 47 |
"format": "json"
|
| 48 |
}
|
|
|
|
| 49 |
response = requests.get(url, params=params, headers=headers)
|
| 50 |
|
|
|
|
|
|
|
|
|
|
| 51 |
response_json = response.json()
|
|
|
|
| 52 |
location = response_json[0]
|
| 53 |
if not location:
|
| 54 |
return None
|