### Working with PDF Files

!pip install unstructured
!pip install chromadb
!pip install Cython
!pip install tiktoken
!pip install unstructured[local-inference]

from langchain.document_loaders import UnstructuredPDFLoader
from langchain.indexes import VectorstoreIndexCreator

# connect your Google Drive
from google.colab import drive
drive.mount('/content/gdrive', force_remount=True)


pdf_folder_path = '/content/gdrive/My Drive/data/wop.pdf'
os.listdir(pdf_folder_path)

loaders = [UnstructuredPDFLoader(os.path.join(pdf_folder_path, fn)) for fn in os.listdir(pdf_folder_path)]
loaders

index = VectorstoreIndexCreator(
    embedding=HuggingFaceEmbeddings(),
    text_splitter=CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)).from_loaders(loaders)

llm=HuggingFaceHub(repo_id="google/flan-t5-xl", model_kwargs={"temperature":0, "max_length":512})

from langchain.chains import RetrievalQA
chain = RetrievalQA.from_chain_type(llm=llm, 
                                    chain_type="stuff", 
                                    retriever=index.vectorstore.as_retriever(), 
                                    input_key="question")

chain.run('How was the GPT4all model trained?')

chain.run('Who are the authors of GPT4all technical report?')

chain.run('What is the model size of GPT4all?')

 Please reply with exactly 4 paragraphs and separate each paragraph with two new lines. The very first paragraph must start with the word "alert".
user