How do i apply ray on pdfs for making pdf reading RAG scaled application using open source like Huggingface?

I am converting pdf to html file and then following the process of chunking and storing. How can i integrate ray here to scale this application for my use case with direct pdf as an input?
Needed help in code!

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline, AutoModelForCausalLM
from langchain import HuggingFacePipeline

from langchain.vectorstores import FAISS

db = FAISS.from_documents(chunks, huggingface_embeddings)

question = " In Q2, what is the revenue growth of ethnic-wear brands?"

searchDocs = db.similarity_search(question)

print(searchDocs[0])

tokenizer = AutoTokenizer.from_pretrained(“google/flan-t5-large”)
model = AutoModelForSeq2SeqLM.from_pretrained(“google/flan-t5-large”)
pipe = pipeline(“text2text-generation”, model=model, tokenizer=tokenizer)
llm = HuggingFacePipeline(
pipeline = pipe,
model_kwargs={“temperature”: 0, “max_length”: 1024},
)
from langchain.chains import RetrievalQA
qa_chain = RetrievalQA.from_chain_type(
llm=llm,
chain_type=“stuff”,
retriever=db.as_retriever(),
chain_type_kwargs={“prompt”: QA_CHAIN_PROMPT}
)
result = qa_chain ({ “query” : question })
print(result[“result”])