Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,16 +31,20 @@ if st.button("Load this report "):
|
|
31 |
loader1 = PyPDFLoader(myurl)
|
32 |
langchainembeddings = OpenAIEmbeddings(deployment="textembedding", chunk_size=1)
|
33 |
|
34 |
-
index = VectorstoreIndexCreator(
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
st.write("loaded")
|
|
|
|
|
|
|
|
|
44 |
|
45 |
|
46 |
|
|
|
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
|
38 |
+
embedding=langchainembeddings,
|
39 |
+
# use Chroma as the vectorestore to index and search embeddings
|
40 |
+
vectorstore_cls=Chroma
|
41 |
+
).from_loaders([loader1])
|
42 |
+
|
43 |
+
st.write("loaded")
|
44 |
+
st.write(langchainembeddings)
|
45 |
+
st.write(index)
|
46 |
+
|
47 |
+
|
48 |
|
49 |
|
50 |
|