Rajagopal commited on
Commit
00f5ccf
·
1 Parent(s): f414072

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -25,11 +25,13 @@ st.header("Welcome!. Today, What company's sustainability story is inspiring you
25
 
26
  myurl = st.text_input("Give the URL to find a sustainability or annual report", "Type URL of any company PDF document here")
27
 
 
 
28
  if st.button("Load this report "):
29
  loader1 = PyPDFLoader(myurl)
30
  langchainembeddings = OpenAIEmbeddings(deployment="textembedding", chunk_size=1)
31
 
32
- index = VectorstoreIndexCreator(
33
  # split the documents into chunks
34
  text_splitter=CharacterTextSplitter(chunk_size=1000, chunk_overlap=0),
35
  # select which embeddings we want to use
@@ -38,7 +40,7 @@ if st.button("Load this report "):
38
  vectorstore_cls=Chroma
39
  ).from_loaders([loader1])
40
 
41
- st.write("loaded")
42
 
43
 
44
 
 
25
 
26
  myurl = st.text_input("Give the URL to find a sustainability or annual report", "Type URL of any company PDF document here")
27
 
28
+ index = None
29
+
30
  if st.button("Load this report "):
31
  loader1 = PyPDFLoader(myurl)
32
  langchainembeddings = OpenAIEmbeddings(deployment="textembedding", chunk_size=1)
33
 
34
+ index = VectorstoreIndexCreator(
35
  # split the documents into chunks
36
  text_splitter=CharacterTextSplitter(chunk_size=1000, chunk_overlap=0),
37
  # select which embeddings we want to use
 
40
  vectorstore_cls=Chroma
41
  ).from_loaders([loader1])
42
 
43
+ st.write("loaded")
44
 
45
 
46