", unsafe_allow_html=True) uploaded_file = st.file_uploader("Upload a PDF file", type="pdf") if uploaded_file: st.success("PDF uploaded successfully! 📄") document_text = extract_text_from_pdf(uploaded_file) st.text_area("📜 Extracted Text", document_text, height=200) query = st.text_input("🔍 Enter your query") if st.button("💬 Get Answer"): if query: with st.spinner("Generating response..."): response = generate_response_groq(document_text, query) st.write("**Response:**") st.write(response) # Clear memory after generating response gc.collect() else: st.error("Please enter a query.") st.markdown("