Skip to content

Commit 5672ed7

Browse files
authored
Merge branch 'abetlen:main' into th-neu-dockerfile-slim
2 parents 5013218 + cabd8b8 commit 5672ed7

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

llama_cpp/llama.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def _create_completion(
639639
self.detokenize([token]).decode("utf-8", errors="ignore")
640640
for token in all_tokens
641641
]
642-
all_logprobs = [Llama._logits_to_logprobs(row) for row in self.eval_logits]
642+
all_logprobs = [Llama.logits_to_logprobs(list(map(float, row))) for row in self.eval_logits]
643643
for token, token_str, logprobs_token in zip(
644644
all_tokens, all_token_strs, all_logprobs
645645
):
@@ -985,7 +985,7 @@ def token_bos() -> llama_cpp.llama_token:
985985
return llama_cpp.llama_token_bos()
986986

987987
@staticmethod
988-
def logits_to_logprobs(logits: List[llama_cpp.c_float]) -> List[llama_cpp.c_float]:
988+
def logits_to_logprobs(logits: List[float]) -> List[float]:
989989
exps = [math.exp(float(x)) for x in logits]
990990
sum_exps = sum(exps)
991-
return [llama_cpp.c_float(math.log(x / sum_exps)) for x in exps]
991+
return [math.log(x / sum_exps) for x in exps]

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "llama_cpp_python"
3-
version = "0.1.41"
3+
version = "0.1.42"
44
description = "Python bindings for the llama.cpp library"
55
authors = ["Andrei Betlen <[email protected]>"]
66
license = "MIT"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
description="A Python wrapper for llama.cpp",
1111
long_description=long_description,
1212
long_description_content_type="text/markdown",
13-
version="0.1.41",
13+
version="0.1.42",
1414
author="Andrei Betlen",
1515
author_email="[email protected]",
1616
license="MIT",

vendor/llama.cpp

0 commit comments

Comments
 (0)