llm = LlamaCpp( model_path=r'C:\Users\UserAdmin\Desktop\vicuna\Wizard-Vicuna-30B-Uncensored.ggmlv3.q2_K.bin', verbose=False, n_ctx=2048, n_gpu_layers=55, n_batch=512, n_threads=11, temperature=0.65) embed_model = LangchainEmbedding(HuggingFaceEmbeddings( model_name=r".\all-mpnet-base-v2", model_kwargs={'device': 'cuda'}) ) llm_predictor = LLMPredictor(llm=llm) service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, chunk_size = 200, embed_model=embed_model) documents = SimpleDirectoryReader(r'.\data\pdfs').load_data() index = VectorStoreIndex.from_documents(documents, service_context=service_context) query_engine = index.as_query_engine(text_qa_template=QA_TEMPLATE)
LangchainEmbedding(HuggingFaceEmbeddings(...), embed_batch_size=20)