Also pass embed model in there otherwise it will start looking for OpenAI key for embedding. Code would change to something like this:
class ResumeScreenerPack(BaseLlamaPack):
def __init__(
self, job_description: str, criteria: List[str], llm: Optional[LLM] = None # PASS YOUR LLAMA2 LLM
) -> None:
self.reader = PDFReader()
llm = llm or OpenAI(model="gpt-4")
service_context = ServiceContext.from_defaults(llm=llm, embed_model='local') # ADD EMBED_MODEL to avoid falling on OpenAI
self.synthesizer = TreeSummarize(
output_cls=ResumeScreenerDecision, service_context=service_context
)
criteria_str = _format_criteria_str(criteria)
self.query = QUERY_TEMPLATE.format(
job_description=job_description, criteria_str=criteria_str
)