Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,14 +22,14 @@ def process_pdf(pdf_path):
|
|
22 |
# Open the PDF
|
23 |
doc = fitz.open(pdf_path)
|
24 |
texts = [page.get_text() for page in doc]
|
25 |
-
|
26 |
return " ".join(texts)
|
27 |
|
28 |
def create_embeddings(text):
|
29 |
-
|
30 |
sentences = text.split(". ") # A simple split; consider a more robust sentence splitter
|
31 |
embeddings = model.encode(sentences)
|
32 |
-
|
33 |
return embeddings, sentences
|
34 |
|
35 |
def generate_plot(query, pdf_file):
|
|
|
22 |
# Open the PDF
|
23 |
doc = fitz.open(pdf_path)
|
24 |
texts = [page.get_text() for page in doc]
|
25 |
+
print("PDF processed successfully.")
|
26 |
return " ".join(texts)
|
27 |
|
28 |
def create_embeddings(text):
|
29 |
+
print("Creating embeddings.")
|
30 |
sentences = text.split(". ") # A simple split; consider a more robust sentence splitter
|
31 |
embeddings = model.encode(sentences)
|
32 |
+
print("Embeddings created successfully.")
|
33 |
return embeddings, sentences
|
34 |
|
35 |
def generate_plot(query, pdf_file):
|