File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Original file line number Diff line number Diff line change @@ -657,18 +657,15 @@ To utilise the cross-encoder, you follow the below code instructions:
657
657
data_path1 = llama_cpp.nlLoader()
658
658
659
659
# Load LlamaCpp GGUF embeddings model and parse in the searchQuery function with the scored passages to generate embeddings
660
- username = os.getenv(" USERNAME" )
661
- print (" " )
662
- try :
663
- llm_embed = Llama(
664
- model_path = f " C: \\ Users \\ { username} \\ Models \\ mxbai \\ mxbai-embed-large-v1.Q4_K_M.gguf " ,
665
- embedding = True ,
660
+ llm_embed = Llama(
661
+ model_path = f " <PATH TO YOUR GGUF EMBEDDINGS MODEL> " ,
662
+ embedding = True ,
666
663
)
667
664
# Store each document in a vector embedding database
668
- for i, d in enumerate (llama_cpp.searchQuery(
669
- question = question
665
+ for i, d in enumerate (llama_cpp.searchQuery(
666
+ question = question
670
667
)):
671
- response = llm_embed.create_embedding(
668
+ response = llm_embed.create_embedding(
672
669
input = d
673
670
)
674
671
embedding = response[" data" ][0 ][" embedding" ]
You can’t perform that action at this time.
0 commit comments