The RAG is a rag
Browse files
app.py
CHANGED
|
@@ -101,16 +101,12 @@ def process_pdf_file(file: AskFileResponse):
|
|
| 101 |
f.write(file.content)
|
| 102 |
|
| 103 |
doc = pymupdf.open(temp_file_path)
|
| 104 |
-
documents = doc.load_documents()
|
| 105 |
-
texts = text_splitter.split_texts(documents)
|
| 106 |
-
return texts
|
| 107 |
-
"""
|
| 108 |
texts = []
|
| 109 |
for page in doc:
|
| 110 |
texts.append(page.get_text())
|
| 111 |
-
|
| 112 |
# os.remove(temp_file_path) checking whether this is better
|
| 113 |
-
|
| 114 |
|
| 115 |
@cl.on_chat_start
|
| 116 |
async def on_chat_start():
|
|
|
|
| 101 |
f.write(file.content)
|
| 102 |
|
| 103 |
doc = pymupdf.open(temp_file_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
texts = []
|
| 105 |
for page in doc:
|
| 106 |
texts.append(page.get_text())
|
| 107 |
+
|
| 108 |
# os.remove(temp_file_path) checking whether this is better
|
| 109 |
+
return texts
|
| 110 |
|
| 111 |
@cl.on_chat_start
|
| 112 |
async def on_chat_start():
|