File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
Original file line number Diff line number Diff line change @@ -654,19 +654,15 @@ llm = Llama(model_path="./models/7B/llama-model.gguf", n_ctx=2048)
654
654
To utilise the cross-encoder, you follow the below code instructions:
655
655
``` python
656
656
# Define the location of your nltk data directory
657
- data_path1 = llama_cpp.nlLoader(nltkData = " <PATH TO NLTK DATA DIRECTORY>" )
657
+ llmx = LlamaX(" <PATH TO YOUR NLTK DATA DIRECTORY>" )
658
+ data_path1 = llama_cpp.nlLoader(nltkData = llmx)
658
659
659
660
# Initialize the sentence-splitter function
660
661
paragraphs1 = llama_cpp.sentSplit()
661
662
662
663
# Define the passSearch function to join sentences
663
664
passages1 = llama_cpp.passSearch()
664
665
665
- # Call the LlamaX class to define the model. Add the path to your Bert cross-encoder.
666
- import os
667
- username = os.getenv(" USERNAME" )
668
- modelPath = LlamaX()
669
-
670
666
# Load LlamaCpp GGUF embeddings model and parse in the searchQuery function with the scored passages to generate embeddings
671
667
username = os.getenv(" USERNAME" )
672
668
print (" " )
Original file line number Diff line number Diff line change 56
56
from ._logger import set_verbose
57
57
from ._utils import suppress_stdout_stderr
58
58
59
+ class LlamaX (str ):
60
+ pass
61
+
59
62
username = os .getenv ("USERNAME" )
60
63
61
64
def models ():
@@ -65,13 +68,6 @@ def models():
65
68
except Exception as e :
66
69
print ("Please add your cross-encoder model." )
67
70
68
- class LlamaX :
69
- def __init__ (self ):
70
- self .model_path = models ()
71
-
72
- def get_model_path (self ) -> str :
73
- return self .model_path
74
-
75
71
def nlLoader (nltkData ):
76
72
nltk_data_dir = Path (nltkData )
77
73
nltk .data .path .append (str (nltk_data_dir ))
You can’t perform that action at this time.
0 commit comments