Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,12 +14,12 @@ class MyApp:
|
|
| 14 |
self.documents = []
|
| 15 |
self.embeddings = None
|
| 16 |
self.index = None
|
| 17 |
-
self.load_text_file("Developmental issue of Environmental culture
|
| 18 |
self.build_vector_db()
|
| 19 |
|
| 20 |
def load_text_file(self, file_path: str) -> None:
|
| 21 |
"""Extracts text from a pdf and stores it in the app's documents."""
|
| 22 |
-
with open(file_path,
|
| 23 |
text = file.read()
|
| 24 |
self.documents.append({"content": text})
|
| 25 |
print("pdf file processed successfully!")
|
|
|
|
| 14 |
self.documents = []
|
| 15 |
self.embeddings = None
|
| 16 |
self.index = None
|
| 17 |
+
self.load_text_file("Developmental issue of Environmental culture") # Replace with your actual pdf path
|
| 18 |
self.build_vector_db()
|
| 19 |
|
| 20 |
def load_text_file(self, file_path: str) -> None:
|
| 21 |
"""Extracts text from a pdf and stores it in the app's documents."""
|
| 22 |
+
with open(file_path,) as file:
|
| 23 |
text = file.read()
|
| 24 |
self.documents.append({"content": text})
|
| 25 |
print("pdf file processed successfully!")
|