Skip to content

Commit 853dc71

Browse files
committed
Format
1 parent 97c6372 commit 853dc71

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

llama_cpp/llama.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,10 @@ def _create_completion(
649649
self.detokenize([token]).decode("utf-8", errors="ignore")
650650
for token in all_tokens
651651
]
652-
all_logprobs = [Llama.logits_to_logprobs(list(map(float, row))) for row in self.eval_logits]
652+
all_logprobs = [
653+
Llama.logits_to_logprobs(list(map(float, row)))
654+
for row in self.eval_logits
655+
]
653656
for token, token_str, logprobs_token in zip(
654657
all_tokens, all_token_strs, all_logprobs
655658
):
@@ -968,7 +971,10 @@ def save_state(self) -> LlamaState:
968971
llama_state_compact = (llama_cpp.c_uint8 * int(n_bytes))()
969972
llama_cpp.ctypes.memmove(llama_state_compact, llama_state, int(n_bytes))
970973
if self.verbose:
971-
print(f"Llama.save_state: saving {n_bytes} bytes of llama state", file=sys.stderr)
974+
print(
975+
f"Llama.save_state: saving {n_bytes} bytes of llama state",
976+
file=sys.stderr,
977+
)
972978
return LlamaState(
973979
eval_tokens=self.eval_tokens.copy(),
974980
eval_logits=self.eval_logits.copy(),

0 commit comments

Comments
 (0)