Spaces:
Sleeping
Sleeping
oops
Browse files
app.py
CHANGED
@@ -123,10 +123,10 @@ if openai_key:
|
|
123 |
# for doc in docs:
|
124 |
# st.write(str(doc.metadata["page"]) + ":", doc.page_content[:300])
|
125 |
|
126 |
-
qa_prompt = st.text_area("Query your pdf",
|
127 |
qa_button = st.button("Let's go!", disabled=not (openai_key and qa_prompt), key="qa_button", help="Make sure you have entered your OpenAI API key and a query.")
|
128 |
|
129 |
if qa_prompt and qa_button:
|
130 |
|
131 |
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=faiss_index.as_retriever())
|
132 |
-
st.write(qa(
|
|
|
123 |
# for doc in docs:
|
124 |
# st.write(str(doc.metadata["page"]) + ":", doc.page_content[:300])
|
125 |
|
126 |
+
qa_prompt = st.text_area("Query your pdf", key="qa_prompt")
|
127 |
qa_button = st.button("Let's go!", disabled=not (openai_key and qa_prompt), key="qa_button", help="Make sure you have entered your OpenAI API key and a query.")
|
128 |
|
129 |
if qa_prompt and qa_button:
|
130 |
|
131 |
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=faiss_index.as_retriever())
|
132 |
+
st.write(qa(qa_prompt))
|