MMQP / app.py
gskdsrikrishna's picture
Update app.py
8ad1ac1 verified
raw
history blame
1.44 kB
import streamlit as st
import importlib
# Define your app modules with icons and images
APPS = [
{"name": "Chat", "module": "chatgskd", "image": "chatgskd.png"},
{"name": "Google", "module": "google", "image": "google.png"},
{"name": "Wikipedia", "module": "wikipedia", "image": "wikipedia.png"},
{"name": "News", "module": "news", "image": "news.png"},
{"name": "YouTube", "module": "youtube", "image": "youtube.png"},
]
# Streamlit UI
st.set_page_config(page_title="Multimodal Query Processing & Knowledge Retrieval System", layout="wide")
st.title("Multimodal Query Processing & Knowledge Retrieval System")
st.subheader("Developed by Gskd")
# Display apps in a 2x3 grid
cols = st.columns(3)
selected_app = None
for i, app in enumerate(APPS):
col = cols[i % 3]
with col:
st.image(app["image"], width=100)
if st.button(app["name"], key=app["name"]):
selected_app = app["module"]
# Load and run the selected app
if selected_app:
try:
app_module = importlib.import_module(selected_app)
if hasattr(app_module, "main"):
app_module.main()
else:
st.error(f"{selected_app}.py must have a `main()` function.")
except ModuleNotFoundError:
st.error(f"Module {selected_app} not found. Make sure {selected_app}.py exists.")
# Footer
st.markdown("---")
st.markdown("© 2025 Gskd and our team members. All rights reserved.")