Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -78,15 +78,16 @@ def process_pdf(file):
|
|
78 |
for page in pdf_reader.pages:
|
79 |
text += page.extract_text()
|
80 |
|
81 |
-
|
82 |
-
embedding = embedding_function([text])[0]
|
83 |
|
84 |
# Store the entire text in ChromaDB
|
85 |
collection.add(
|
86 |
documents=[text],
|
87 |
metadatas=[{"filename": file.name}],
|
88 |
-
ids=[file.name] # Use the filename as the ID
|
89 |
)
|
|
|
|
|
90 |
return f"PDF wurde erfolgreich in ChromaDB gespeichert."
|
91 |
|
92 |
def search_similar_documents(prompt):
|
|
|
78 |
for page in pdf_reader.pages:
|
79 |
text += page.extract_text()
|
80 |
|
81 |
+
embeddings = embedding_function([text])
|
|
|
82 |
|
83 |
# Store the entire text in ChromaDB
|
84 |
collection.add(
|
85 |
documents=[text],
|
86 |
metadatas=[{"filename": file.name}],
|
87 |
+
ids=[file.name] # Use the filename as the unique ID
|
88 |
)
|
89 |
+
|
90 |
+
|
91 |
return f"PDF wurde erfolgreich in ChromaDB gespeichert."
|
92 |
|
93 |
def search_similar_documents(prompt):
|