mgokg commited on
Commit
33863b9
·
verified ·
1 Parent(s): fdeebc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- # Create embedding for the entire text
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):