llama-cpp-python 0.1.8__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/PKG-INFO +1 -1
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp/llama.py +14 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp_python.egg-info/PKG-INFO +1 -1
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/pyproject.toml +1 -1
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/setup.py +1 -1
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/.gitignore +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/.gitmodules +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/CMakeLists.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/LICENSE.md +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/README.md +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/_skbuild/linux-x86_64-3.8/cmake-install/llama_cpp/libllama.so +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp/__init__.py +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp/llama_cpp.py +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp_python.egg-info/SOURCES.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp_python.egg-info/dependency_links.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp_python.egg-info/top_level.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/poetry.lock +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/setup.cfg +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.devops/full.Dockerfile +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.devops/main.Dockerfile +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.devops/tools.sh +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.dockerignore +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.github/ISSUE_TEMPLATE/custom.md +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.github/workflows/build.yml +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.github/workflows/docker.yml +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.gitignore +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/CMakeLists.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/LICENSE +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/Makefile +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/README.md +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/SHA256SUMS +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/convert-gptq-to-ggml.py +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/convert-pth-to-ggml.py +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/flake.lock +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/flake.nix +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/ggml.c +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/ggml.h +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/llama.cpp +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/llama.h +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/models/ggml-vocab.bin +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/prompts/alpaca.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/prompts/chat-with-bob.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/quantize.py +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/tests/CMakeLists.txt +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/tests/test-quantize.c +0 -0
- {llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/tests/test-tokenizer-0.cpp +0 -0
|
@@ -105,6 +105,20 @@ class Llama:
|
|
|
105
105
|
output += llama_cpp.llama_token_to_str(self.ctx, token)
|
|
106
106
|
return output
|
|
107
107
|
|
|
108
|
+
def embed(self, text: str):
|
|
109
|
+
"""Embed a string.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
text: The utf-8 encoded string to embed.
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
A list of embeddings.
|
|
116
|
+
"""
|
|
117
|
+
tokens = self.tokenize(text.encode("utf-8"))
|
|
118
|
+
self._eval(tokens, 0)
|
|
119
|
+
embeddings = llama_cpp.llama_get_embeddings(self.ctx)
|
|
120
|
+
return embeddings[:llama_cpp.llama_n_embd(self.ctx)]
|
|
121
|
+
|
|
108
122
|
def _eval(self, tokens: List[int], n_past):
|
|
109
123
|
rc = llama_cpp.llama_eval(
|
|
110
124
|
self.ctx,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/llama_cpp_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.github/ISSUE_TEMPLATE/custom.md
RENAMED
|
File without changes
|
{llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.github/workflows/build.yml
RENAMED
|
File without changes
|
{llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/.github/workflows/docker.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/prompts/chat-with-bob.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_cpp_python-0.1.8 → llama_cpp_python-0.1.9}/vendor/llama.cpp/tests/test-tokenizer-0.cpp
RENAMED
|
File without changes
|