Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -429,8 +429,6 @@ def initialize():
|
|
429 |
|
430 |
from langchain_community.document_loaders import TextLoader
|
431 |
|
432 |
-
loader1 = TextLoader(r"C:\Users\Anwender\Downloads\testing.txt")
|
433 |
-
doc1 = loader1.load()
|
434 |
|
435 |
with tempfile.TemporaryDirectory() as tmp_dir_path:
|
436 |
|
@@ -443,7 +441,7 @@ def initialize():
|
|
443 |
home = os.path.join(tmp_dir_path, new_sub_path)
|
444 |
|
445 |
embedding_model = HuggingFaceEmbeddings(model_name=EMBEDDING_MODEL_NAME)
|
446 |
-
vectorstore = Chroma.from_texts(texts=
|
447 |
|
448 |
print("Appended path stored in 'home':", home)
|
449 |
|
|
|
429 |
|
430 |
from langchain_community.document_loaders import TextLoader
|
431 |
|
|
|
|
|
432 |
|
433 |
with tempfile.TemporaryDirectory() as tmp_dir_path:
|
434 |
|
|
|
441 |
home = os.path.join(tmp_dir_path, new_sub_path)
|
442 |
|
443 |
embedding_model = HuggingFaceEmbeddings(model_name=EMBEDDING_MODEL_NAME)
|
444 |
+
vectorstore = Chroma.from_texts(texts=doc_chunks, embedding=embedding_model, persist_directory=home)
|
445 |
|
446 |
print("Appended path stored in 'home':", home)
|
447 |
|