PDF now working update
Browse files- app.py +0 -2
- requirements.txt +0 -1
app.py
CHANGED
@@ -11,7 +11,6 @@ from aimakerspace.openai_utils.embedding import EmbeddingModel
|
|
11 |
from aimakerspace.vectordatabase import VectorDatabase
|
12 |
from aimakerspace.openai_utils.chatmodel import ChatOpenAI
|
13 |
import chainlit as cl
|
14 |
-
from PyPDF2 import PdfReader
|
15 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
16 |
|
17 |
system_template = """\
|
@@ -70,7 +69,6 @@ def process_text_file(file: AskFileResponse):
|
|
70 |
documents = pdf_loader.load()
|
71 |
else:
|
72 |
raise ValueError("Provide a .txt or .pdf file")
|
73 |
-
# texts = text_splitter.split_texts(documents)
|
74 |
texts = [x.page_content for x in text_splitter.transform_documents(documents)]
|
75 |
return texts
|
76 |
|
|
|
11 |
from aimakerspace.vectordatabase import VectorDatabase
|
12 |
from aimakerspace.openai_utils.chatmodel import ChatOpenAI
|
13 |
import chainlit as cl
|
|
|
14 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
15 |
|
16 |
system_template = """\
|
|
|
69 |
documents = pdf_loader.load()
|
70 |
else:
|
71 |
raise ValueError("Provide a .txt or .pdf file")
|
|
|
72 |
texts = [x.page_content for x in text_splitter.transform_documents(documents)]
|
73 |
return texts
|
74 |
|
requirements.txt
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
numpy
|
2 |
chainlit==0.7.700
|
3 |
openai
|
4 |
-
PyPDF2
|
5 |
langchain-community
|
6 |
pypdf
|
7 |
langchain-text-splitters
|
|
|
1 |
numpy
|
2 |
chainlit==0.7.700
|
3 |
openai
|
|
|
4 |
langchain-community
|
5 |
pypdf
|
6 |
langchain-text-splitters
|