Chandranshu Jain commited on
Commit
3096731
1 Parent(s): 7a9dcc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,7 +39,7 @@ def get_pdf(uploaded_file):
39
  file.write(uploaded_file.getvalue())
40
  file_name = uploaded_file.name
41
  loader = PyPDFLoader(temp_file)
42
- docs = loader.load()
43
  return docs
44
 
45
  def text_splitter(text):
@@ -48,7 +48,7 @@ def text_splitter(text):
48
  chunk_size=500,
49
  chunk_overlap=20,
50
  separators=["\n\n","\n"," ",".",","])
51
- chunks=text_splitter.split_text(text)
52
  return chunks
53
 
54
  GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
 
39
  file.write(uploaded_file.getvalue())
40
  file_name = uploaded_file.name
41
  loader = PyPDFLoader(temp_file)
42
+ docs = loader.load_and_split()
43
  return docs
44
 
45
  def text_splitter(text):
 
48
  chunk_size=500,
49
  chunk_overlap=20,
50
  separators=["\n\n","\n"," ",".",","])
51
+ chunks=text_splitter.split_documents(text)
52
  return chunks
53
 
54
  GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")