restructured
Browse files
app.py
CHANGED
@@ -4,55 +4,55 @@ from streamlit_pdf_viewer import pdf_viewer
|
|
4 |
|
5 |
st.set_page_config(layout="wide")
|
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 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
col1, col2 = st.columns(2)
|
57 |
|
58 |
with col2:
|
|
|
4 |
|
5 |
st.set_page_config(layout="wide")
|
6 |
|
7 |
+
with st.sidebar:
|
8 |
+
st.title('Document Summarization and QA System')
|
9 |
+
# st.markdown('''
|
10 |
+
# ## About this application
|
11 |
+
# Upload a pdf to ask questions about it. This retrieval-augmented generation (RAG) workflow uses:
|
12 |
+
# - [Streamlit](https://streamlit.io/)
|
13 |
+
# - [LlamaIndex](https://docs.llamaindex.ai/en/stable/)
|
14 |
+
# - [OpenAI](https://platform.openai.com/docs/models)
|
15 |
+
# ''')
|
16 |
+
|
17 |
+
# st.write('Made by ***Nate Mahynski***')
|
18 |
+
# st.write('nathan.mahynski@nist.gov')
|
19 |
+
|
20 |
+
# Select Provider
|
21 |
+
provider = st.selectbox(
|
22 |
+
label="Select LLM Provider",
|
23 |
+
options=['openai', 'huggingface'],
|
24 |
+
index=0
|
25 |
+
)
|
26 |
+
|
27 |
+
# Select LLM
|
28 |
+
if provider == 'openai':
|
29 |
+
llm_list = ['gpt-3.5-turbo', 'gpt-4', 'gpt-4-turbo', 'gpt-4o']
|
30 |
+
else:
|
31 |
+
llm_list = []
|
32 |
+
|
33 |
+
llm = st.selectbox(
|
34 |
+
label="Select LLM Model",
|
35 |
+
options=llm_list,
|
36 |
+
index=0
|
37 |
+
)
|
38 |
+
|
39 |
+
# Enter Token
|
40 |
+
token = st.text_input(
|
41 |
+
"Enter your token",
|
42 |
+
value=None
|
43 |
+
)
|
44 |
+
|
45 |
+
uploaded_file = st.file_uploader(
|
46 |
+
"Choose a PDF file to upload",
|
47 |
+
type=['pdf'],
|
48 |
+
accept_multiple_files=False
|
49 |
+
)
|
50 |
+
|
51 |
+
if uploaded_file is not None:
|
52 |
+
# Parse the file
|
53 |
+
pass
|
54 |
+
|
55 |
+
def main()
|
56 |
col1, col2 = st.columns(2)
|
57 |
|
58 |
with col2:
|