Mehrdad Esmaeili commited on
Commit ·
6039711
1
Parent(s): ef79e1c
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,12 +44,12 @@ for file in os.listdir(path):
|
|
| 44 |
documents += loader.load()
|
| 45 |
text_splitter = CharacterTextSplitter(chunk_size=500, chunk_overlap=0)
|
| 46 |
texts = text_splitter.split_documents(documents)
|
| 47 |
-
embeddings = CohereEmbeddings(model='embed-english-v3.0')
|
| 48 |
-
|
| 49 |
docsearch = Chroma.from_documents(texts, embeddings)
|
| 50 |
retriever=docsearch.as_retriever()
|
| 51 |
-
cohereLLM=Cohere(model='command')
|
| 52 |
-
|
| 53 |
# Initialize the CohereRerank compressor and the ContextualCompressionRetriever
|
| 54 |
compressor = CohereRerank(user_agent='MyTool/1.0 (Linux; x86_64)')
|
| 55 |
compression_retriever = ContextualCompressionRetriever(
|
|
|
|
| 44 |
documents += loader.load()
|
| 45 |
text_splitter = CharacterTextSplitter(chunk_size=500, chunk_overlap=0)
|
| 46 |
texts = text_splitter.split_documents(documents)
|
| 47 |
+
# embeddings = CohereEmbeddings(model='embed-english-v3.0')
|
| 48 |
+
embeddings = OpenAIEmbeddings()
|
| 49 |
docsearch = Chroma.from_documents(texts, embeddings)
|
| 50 |
retriever=docsearch.as_retriever()
|
| 51 |
+
# cohereLLM=Cohere(model='command')
|
| 52 |
+
cohereLLM=OpenAI()
|
| 53 |
# Initialize the CohereRerank compressor and the ContextualCompressionRetriever
|
| 54 |
compressor = CohereRerank(user_agent='MyTool/1.0 (Linux; x86_64)')
|
| 55 |
compression_retriever = ContextualCompressionRetriever(
|