Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,11 +79,27 @@ def geolocate_text_byt5(text):
|
|
| 79 |
|
| 80 |
model = ByT5ForTextGeotagging.from_pretrained("yachay/byt5-geotagging-es", token="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")
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
# Streamlit interface
|
| 85 |
st.title('GeoTagging using ByT5')
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
if text_input:
|
| 88 |
location = geolocate_text_byt5(text_input)
|
| 89 |
st.write('Predicted Location: ', location)
|
|
|
|
| 79 |
|
| 80 |
model = ByT5ForTextGeotagging.from_pretrained("yachay/byt5-geotagging-es", token="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")
|
| 81 |
|
| 82 |
+
|
| 83 |
+
example_texts = [
|
| 84 |
+
"Disfrutando de una paella deliciosa en las playas de #Valencia 🥘☀️",
|
| 85 |
+
"La arquitectura de #Tokio es realmente algo fuera de este mundo 🌆🇯🇵",
|
| 86 |
+
"Escuchando jazz en un café acogedor en el corazón de #NuevaOrleans 🎷🎶",
|
| 87 |
+
"Los atardeceres en #CapeTown con la vista del Monte Table son inolvidables 🌅🇿🇦",
|
| 88 |
+
"Nada se compara con caminar por las históricas calles de #Roma 🏛️🍕"
|
| 89 |
+
]
|
| 90 |
+
|
| 91 |
|
| 92 |
# Streamlit interface
|
| 93 |
st.title('GeoTagging using ByT5')
|
| 94 |
+
|
| 95 |
+
# Buttons for example texts
|
| 96 |
+
for ex_text in example_texts:
|
| 97 |
+
if st.button(f'Example: "{ex_text[:30]}..."'):
|
| 98 |
+
text_input = ex_text
|
| 99 |
+
|
| 100 |
+
text_input = st.text_input('Enter your text:', value=text_input if 'text_input' in locals() else '')
|
| 101 |
+
|
| 102 |
+
|
| 103 |
if text_input:
|
| 104 |
location = geolocate_text_byt5(text_input)
|
| 105 |
st.write('Predicted Location: ', location)
|