Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -12
src/streamlit_app.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from PIL import Image
|
| 3 |
import requests
|
| 4 |
-
from io import BytesIO
|
| 5 |
|
| 6 |
-
st.set_page_config(page_title="WikiExplorer
|
| 7 |
-
st.title("
|
| 8 |
|
| 9 |
# --- Multilingual language selector ---
|
| 10 |
lang = st.selectbox(
|
|
@@ -24,13 +23,6 @@ lang_code = lang[1]
|
|
| 24 |
st.markdown("**π Enter a place or person name to learn more:**")
|
| 25 |
place_name = st.text_input("ποΈ For example: Charminar, Taj Mahal, Shah Jahan")
|
| 26 |
|
| 27 |
-
# --- Camera input (optional) ---
|
| 28 |
-
img_file_buffer = st.camera_input("πΈ Take a picture (optional)")
|
| 29 |
-
|
| 30 |
-
if img_file_buffer is not None:
|
| 31 |
-
st.markdown("### π· Captured Image")
|
| 32 |
-
st.image(img_file_buffer, caption="Uploaded via camera", use_column_width=True)
|
| 33 |
-
|
| 34 |
# --- Translation helpers ---
|
| 35 |
def translate_text(text, target_lang):
|
| 36 |
try:
|
|
@@ -125,8 +117,8 @@ if place_name.strip():
|
|
| 125 |
# --- Footer ---
|
| 126 |
st.markdown("""
|
| 127 |
---
|
| 128 |
-
-
|
| 129 |
- π Wikipedia multilingual summary with fallback + sentence-level translation.
|
| 130 |
- πΌοΈ Commons image gallery integration.
|
| 131 |
-
- β
Works
|
| 132 |
""")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from PIL import Image
|
| 3 |
import requests
|
|
|
|
| 4 |
|
| 5 |
+
st.set_page_config(page_title="WikiExplorer", layout="centered")
|
| 6 |
+
st.title("π WikiExplorer (Multilingual Edition)")
|
| 7 |
|
| 8 |
# --- Multilingual language selector ---
|
| 9 |
lang = st.selectbox(
|
|
|
|
| 23 |
st.markdown("**π Enter a place or person name to learn more:**")
|
| 24 |
place_name = st.text_input("ποΈ For example: Charminar, Taj Mahal, Shah Jahan")
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
# --- Translation helpers ---
|
| 27 |
def translate_text(text, target_lang):
|
| 28 |
try:
|
|
|
|
| 117 |
# --- Footer ---
|
| 118 |
st.markdown("""
|
| 119 |
---
|
| 120 |
+
- βοΈ Type a place or personβs name to learn about them instantly.
|
| 121 |
- π Wikipedia multilingual summary with fallback + sentence-level translation.
|
| 122 |
- πΌοΈ Commons image gallery integration.
|
| 123 |
+
- β
Works seamlessly on Hugging Face Spaces with Streamlit.
|
| 124 |
""")
|