Spaces:
Build error
Build error
Commit ·
bf505c6
1
Parent(s): 95e937e
updated pom file
Browse files
app.py
CHANGED
|
@@ -50,6 +50,16 @@ elif genre==radioButtonList[2]:
|
|
| 50 |
pdfCSVURLText = "PDF"
|
| 51 |
elif genre==radioButtonList[3]:
|
| 52 |
pdfCSVURLText = "URL"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
elif genre==radioButtonList[4]:
|
| 54 |
pdfCSVURLText = "URL"
|
| 55 |
|
|
@@ -109,17 +119,6 @@ if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr):
|
|
| 109 |
st.write(pdf_answer)
|
| 110 |
|
| 111 |
elif genre==radioButtonList[3]: # Google Alphabet URL Earnings Report
|
| 112 |
-
|
| 113 |
-
urls = ['https://www.sec.gov/Archives/edgar/data/1652044/000165204422000071/goog-20220630.htm',]
|
| 114 |
-
loader = [UnstructuredURLLoader(urls=urls)]
|
| 115 |
-
index = VectorstoreIndexCreator(
|
| 116 |
-
embedding=GooglePalmEmbeddings(),
|
| 117 |
-
text_splitter=CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)).from_loaders(loader)
|
| 118 |
-
|
| 119 |
-
chain = RetrievalQA.from_chain_type(llm=llm,
|
| 120 |
-
chain_type="stuff",
|
| 121 |
-
retriever=index.vectorstore.as_retriever(),
|
| 122 |
-
input_key="question")
|
| 123 |
answer = chain.run(chatTextStr)
|
| 124 |
st.write(answer)
|
| 125 |
|
|
|
|
| 50 |
pdfCSVURLText = "PDF"
|
| 51 |
elif genre==radioButtonList[3]:
|
| 52 |
pdfCSVURLText = "URL"
|
| 53 |
+
urls = ['https://www.sec.gov/Archives/edgar/data/1652044/000165204422000071/goog-20220630.htm',]
|
| 54 |
+
loader = [UnstructuredURLLoader(urls=urls)]
|
| 55 |
+
index = VectorstoreIndexCreator(
|
| 56 |
+
embedding=GooglePalmEmbeddings(),
|
| 57 |
+
text_splitter=CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)).from_loaders(loader)
|
| 58 |
+
|
| 59 |
+
chain = RetrievalQA.from_chain_type(llm=llm,
|
| 60 |
+
chain_type="stuff",
|
| 61 |
+
retriever=index.vectorstore.as_retriever(),
|
| 62 |
+
input_key="question")
|
| 63 |
elif genre==radioButtonList[4]:
|
| 64 |
pdfCSVURLText = "URL"
|
| 65 |
|
|
|
|
| 119 |
st.write(pdf_answer)
|
| 120 |
|
| 121 |
elif genre==radioButtonList[3]: # Google Alphabet URL Earnings Report
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
answer = chain.run(chatTextStr)
|
| 123 |
st.write(answer)
|
| 124 |
|