Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,11 @@ if uploaded_file is not None:
|
|
40 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=200)
|
41 |
texts = text_splitter.split_text(context)
|
42 |
|
|
|
|
|
43 |
# Chroma Embeddings
|
44 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
45 |
-
vector_index = Chroma.from_texts(texts,
|
46 |
|
47 |
# Get User Question
|
48 |
user_question = st.text_input("Ask a Question:")
|
|
|
40 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=200)
|
41 |
texts = text_splitter.split_text(context)
|
42 |
|
43 |
+
persist_directory="data"
|
44 |
+
|
45 |
# Chroma Embeddings
|
46 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
47 |
+
vector_index = Chroma.from_texts( texts=texts,embedding=embeddings,persist_directory=persist_directory).as_retriever()
|
48 |
|
49 |
# Get User Question
|
50 |
user_question = st.text_input("Ask a Question:")
|