Alpaca233 commited on
Commit
e4eb66d
1 Parent(s): 3ba07b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
 
3
- from langchain.document_loaders import PyPDFLoader # for loading the pdf
4
  from langchain.embeddings import OpenAIEmbeddings # for creating embeddings
5
  from langchain.vectorstores import Chroma # for the vectorization part
6
  from langchain.chains import ChatVectorDBChain # for chatting with the pdf
@@ -10,7 +10,7 @@ from langchain.llms import OpenAI # the LLM model we'll use (CHatGPT)
10
  class Chat:
11
  def __init__(self, pdf, api_input):
12
  self.api = api_input
13
- loader = PyPDFLoader(pdf)
14
  pages = loader.load_and_split()
15
 
16
  embeddings = OpenAIEmbeddings(openai_api_key=self.api)
 
1
  import gradio as gr
2
 
3
+ from langchain.document_loaders import PyMuPDFLoader # for loading the pdf
4
  from langchain.embeddings import OpenAIEmbeddings # for creating embeddings
5
  from langchain.vectorstores import Chroma # for the vectorization part
6
  from langchain.chains import ChatVectorDBChain # for chatting with the pdf
 
10
  class Chat:
11
  def __init__(self, pdf, api_input):
12
  self.api = api_input
13
+ loader = PyMuPDFLoader(pdf)
14
  pages = loader.load_and_split()
15
 
16
  embeddings = OpenAIEmbeddings(openai_api_key=self.api)