Spaces:
Sleeping
Sleeping
Commit
·
853fad2
1
Parent(s):
fcfd8b5
Update app.py
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ recommender = SemanticSearch()
|
|
125 |
|
126 |
st.title('PDF GPT')
|
127 |
|
128 |
-
description = """ PDF GPT allows you to chat with your PDF file using Universal Sentence Encoder and Open AI.
|
129 |
|
130 |
st.markdown(description)
|
131 |
|
@@ -134,11 +134,12 @@ openAI_key = st.sidebar.text_input('Enter your OpenAI API key here')
|
|
134 |
col1, col2, col3, col4 = st.columns(4)
|
135 |
|
136 |
with col1:
|
137 |
-
url = st.text_input('
|
138 |
with col2:
|
139 |
question = st.text_input('Question')
|
140 |
with col3:
|
141 |
-
answer_placeholder = st.empty()
|
|
|
142 |
with col4:
|
143 |
if st.button('Submit'):
|
144 |
if openAI_key.strip()=='':
|
@@ -153,4 +154,4 @@ with col4:
|
|
153 |
load_recommender('corpus.pdf')
|
154 |
|
155 |
answer = generate_answer(question,openAI_key)
|
156 |
-
answer_placeholder.text_area('Answer', value=answer, height=
|
|
|
125 |
|
126 |
st.title('PDF GPT')
|
127 |
|
128 |
+
description = """ PDF GPT allows you to chat with your PDF file using Universal Sentence Encoder and Open AI. The returned response can cite the page number in square brackets([]) where the information is located, adding credibility to the responses and helping to locate pertinent information quickly."""
|
129 |
|
130 |
st.markdown(description)
|
131 |
|
|
|
134 |
col1, col2, col3, col4 = st.columns(4)
|
135 |
|
136 |
with col1:
|
137 |
+
url = st.text_input('PDF URL')
|
138 |
with col2:
|
139 |
question = st.text_input('Question')
|
140 |
with col3:
|
141 |
+
answer_placeholder = st.empty() # Create an empty placeholder for the 'Answer' box
|
142 |
+
answer_placeholder.text_area('Answer', value='', height=40) # Initialize the 'Answer' box with an empty string
|
143 |
with col4:
|
144 |
if st.button('Submit'):
|
145 |
if openAI_key.strip()=='':
|
|
|
154 |
load_recommender('corpus.pdf')
|
155 |
|
156 |
answer = generate_answer(question,openAI_key)
|
157 |
+
answer_placeholder.text_area('Answer', value=answer, height=40) # Fill in the 'Answer' box with the generated answer
|