Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 42a50e2

Browse filesBrowse files
Updated README and llama_cpp/llama.py
1 parent d797085 commit 42a50e2
Copy full SHA for 42a50e2

File tree

Expand file treeCollapse file tree

2 files changed

+5
-13
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-13
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -654,19 +654,15 @@ llm = Llama(model_path="./models/7B/llama-model.gguf", n_ctx=2048)
654654
To utilise the cross-encoder, you follow the below code instructions:
655655
```python
656656
# 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)
658659

659660
# Initialize the sentence-splitter function
660661
paragraphs1 = llama_cpp.sentSplit()
661662

662663
# Define the passSearch function to join sentences
663664
passages1 = llama_cpp.passSearch()
664665

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-
670666
# Load LlamaCpp GGUF embeddings model and parse in the searchQuery function with the scored passages to generate embeddings
671667
username = os.getenv("USERNAME")
672668
print("")

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+3-7Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
from ._logger import set_verbose
5757
from ._utils import suppress_stdout_stderr
5858

59+
class LlamaX(str):
60+
pass
61+
5962
username = os.getenv("USERNAME")
6063

6164
def models():
@@ -65,13 +68,6 @@ def models():
6568
except Exception as e:
6669
print("Please add your cross-encoder model.")
6770

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-
7571
def nlLoader(nltkData):
7672
nltk_data_dir = Path(nltkData)
7773
nltk.data.path.append(str(nltk_data_dir))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.