M17idd commited on
Commit
de92d51
·
1 Parent(s): eef506a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -126,7 +126,7 @@ class HuggingFaceEmbeddings(Embeddings):
126
  return self.embed_documents([text])[0]
127
 
128
  @st.cache_resource
129
- def get_pdf_text(pdf_docs="test1.pdf"):
130
  loader = PyPDFLoader('test1.pdf')
131
  embeddings = HuggingFaceInstructEmbeddings(model_name="SajjadAyoubi/xlm-roberta-large-fa-qa")
132
  index = VectorstoreIndexCreator( embedding=embeddings, text_splitter=RecursiveCharacterTextSplitter(chunk_size=300, chunk_overlap=0)).from_loaders(pdf_reader)
 
126
  return self.embed_documents([text])[0]
127
 
128
  @st.cache_resource
129
+ def get_pdf_index(pdf_docs="test1.pdf"):
130
  loader = PyPDFLoader('test1.pdf')
131
  embeddings = HuggingFaceInstructEmbeddings(model_name="SajjadAyoubi/xlm-roberta-large-fa-qa")
132
  index = VectorstoreIndexCreator( embedding=embeddings, text_splitter=RecursiveCharacterTextSplitter(chunk_size=300, chunk_overlap=0)).from_loaders(pdf_reader)