Spaces:
Sleeping
Sleeping
Update chroma_utils.py
Browse files- chroma_utils.py +3 -1
chroma_utils.py
CHANGED
|
@@ -5,9 +5,11 @@ from langchain_chroma import Chroma
|
|
| 5 |
from typing import List
|
| 6 |
from langchain_core.documents import Document
|
| 7 |
import os
|
|
|
|
|
|
|
| 8 |
|
| 9 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200, length_function=len)
|
| 10 |
-
embedding_function =
|
| 11 |
vectorstore = Chroma(persist_directory="./chroma_db", embedding_function=embedding_function)
|
| 12 |
|
| 13 |
def load_and_split_document(file_path: str) -> List[Document]:
|
|
|
|
| 5 |
from typing import List
|
| 6 |
from langchain_core.documents import Document
|
| 7 |
import os
|
| 8 |
+
from langchain_google_genai import GoogleGenerativeAIEmbeddings
|
| 9 |
+
|
| 10 |
|
| 11 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200, length_function=len)
|
| 12 |
+
embedding_function = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
| 13 |
vectorstore = Chroma(persist_directory="./chroma_db", embedding_function=embedding_function)
|
| 14 |
|
| 15 |
def load_and_split_document(file_path: str) -> List[Document]:
|