Spaces:
Running
Running
Commit
·
ab0189e
1
Parent(s):
3caae59
Set duplicate policy using enum
Browse files
main.py
CHANGED
@@ -16,6 +16,7 @@ from haystack.components.writers import DocumentWriter
|
|
16 |
from haystack.core.pipeline import Pipeline
|
17 |
from haystack.dataclasses import GeneratedAnswer
|
18 |
from haystack.document_stores.in_memory import InMemoryDocumentStore
|
|
|
19 |
|
20 |
# Load the environment variables, we're going to need it for OpenAI
|
21 |
load_dotenv()
|
@@ -103,7 +104,7 @@ def index_files(files):
|
|
103 |
document_cleaner = DocumentCleaner()
|
104 |
document_splitter = DocumentSplitter()
|
105 |
document_writer = DocumentWriter(
|
106 |
-
document_store=document_store(), policy=
|
107 |
)
|
108 |
|
109 |
# And our pipeline
|
|
|
16 |
from haystack.core.pipeline import Pipeline
|
17 |
from haystack.dataclasses import GeneratedAnswer
|
18 |
from haystack.document_stores.in_memory import InMemoryDocumentStore
|
19 |
+
from haystack.document_stores.types import DuplicatePolicy
|
20 |
|
21 |
# Load the environment variables, we're going to need it for OpenAI
|
22 |
load_dotenv()
|
|
|
104 |
document_cleaner = DocumentCleaner()
|
105 |
document_splitter = DocumentSplitter()
|
106 |
document_writer = DocumentWriter(
|
107 |
+
document_store=document_store(), policy=DuplicatePolicy.OVERWRITE
|
108 |
)
|
109 |
|
110 |
# And our pipeline
|