File size: 721 Bytes
5476705
84cd0ba
5476705
8038b86
 
 
 
5476705
8038b86
 
 
5476705
8038b86
 
5476705
8038b86
 
5476705
8038b86
 
 
 
c48ecd4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
from prediction import Prediction

# Initialize model only once using Streamlit cache
@st.cache_resource
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)