-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
30 lines (24 loc) · 888 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st
from QA_System.ingestion import load_and_split_pdfs
from QA_System.ingestion import create_faiss_index
import os
from QA_System.retrievalandgeneration import get_response_llm
st.title("RAG APP Using Bedrock")
with st.sidebar:
if st.button("Update FAISS Index"):
st.write("Processing PDF files...")
chunks = load_and_split_pdfs()
st.write(f"Total chunks created: {len(chunks)}")
st.write("Creating and saving FAISS index...")
create_faiss_index(chunks)
st.write("FAISS index has been updated!")
st.header("LLaMA Query")
query = st.text_input("Enter your query:")
if st.button("Send to Model"):
if query:
st.write("Processing your query...")
response = get_response_llm(query)
st.write("Response:")
st.write(response)
else:
st.write("Please enter a query.")