Spaces:
Sleeping
Sleeping
Download src/streamlit_app.py from istiak101/probahoni_plus: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/spaces/istiak101/probahoni_plus/resolve/main/src/streamlit_app.py
- Command line
-
hf download hf://spaces/istiak101/probahoni_plus/src/streamlit_app.py
-
curl -L -o streamlit_app.py https://huggingface.co/spaces/istiak101/probahoni_plus/resolve/main/src/streamlit_app.py
721 Bytes
| import streamlit as st | |
| from prediction import Prediction | |
| # Initialize model only once using Streamlit cache | |
| def load_predictor(): | |
| return Prediction() | |
| st.set_page_config(page_title="Bangla-English QA", layout="centered") | |
| st.title("Multilingual QA System") | |
| st.markdown("Ask a question in **Bangla** or **English**, and get an AI-generated answer based on KB context.") | |
| # Input from user | |
| user_query = st.text_input("🔎 Enter your question:", "") | |
| # Load model | |
| predictor = load_predictor() | |
| if st.button("Generate Answer") and user_query.strip(): | |
| with st.spinner("Generating answer..."): | |
| result = predictor.predict(user_query) | |
| st.markdown("### Answer") | |
| st.write(result) |