Spaces:
Runtime error
Runtime error
Update preprocess_chunks.py
Browse files- preprocess_chunks.py +2 -2
preprocess_chunks.py
CHANGED
|
@@ -31,11 +31,11 @@ def preprocess_chunks():
|
|
| 31 |
|
| 32 |
print(f"✅ {len(os.listdir(OUT_DIR))} dosya yazıldı → {OUT_DIR}/")
|
| 33 |
|
| 34 |
-
|
| 35 |
def embed_chunks():
|
| 36 |
print("⚙️ Generating embeddings and persisting to chromadb/ …")
|
| 37 |
docs = DirectoryLoader(OUT_DIR, glob="**/*.txt").load()
|
| 38 |
-
db = Chroma.from_documents(docs, OpenAIEmbeddings(), persist_directory=
|
| 39 |
db.persist()
|
| 40 |
print("✅ Embedding işlemi tamamlandı.")
|
| 41 |
|
|
|
|
| 31 |
|
| 32 |
print(f"✅ {len(os.listdir(OUT_DIR))} dosya yazıldı → {OUT_DIR}/")
|
| 33 |
|
| 34 |
+
CHROMADB_DIR = "/tmp/chromadb"
|
| 35 |
def embed_chunks():
|
| 36 |
print("⚙️ Generating embeddings and persisting to chromadb/ …")
|
| 37 |
docs = DirectoryLoader(OUT_DIR, glob="**/*.txt").load()
|
| 38 |
+
db = Chroma.from_documents(docs, OpenAIEmbeddings(), persist_directory=CHROMADB_DIR)
|
| 39 |
db.persist()
|
| 40 |
print("✅ Embedding işlemi tamamlandı.")
|
| 41 |
|