Bugfix: Ensure logs are printed when streaming
This commit is contained in:
parent
3c96b43cf4
commit
cdeaded251
1 changed files with 3 additions and 3 deletions
|
@ -709,6 +709,9 @@ class Llama:
|
||||||
print("Llama._create_completion: cache save", file=sys.stderr)
|
print("Llama._create_completion: cache save", file=sys.stderr)
|
||||||
self.cache[prompt_tokens + completion_tokens] = self.save_state()
|
self.cache[prompt_tokens + completion_tokens] = self.save_state()
|
||||||
|
|
||||||
|
if self.verbose:
|
||||||
|
llama_cpp.llama_print_timings(self.ctx)
|
||||||
|
|
||||||
if stream:
|
if stream:
|
||||||
yield {
|
yield {
|
||||||
"id": completion_id,
|
"id": completion_id,
|
||||||
|
@ -780,9 +783,6 @@ class Llama:
|
||||||
"top_logprobs": top_logprobs,
|
"top_logprobs": top_logprobs,
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.verbose:
|
|
||||||
llama_cpp.llama_print_timings(self.ctx)
|
|
||||||
|
|
||||||
yield {
|
yield {
|
||||||
"id": completion_id,
|
"id": completion_id,
|
||||||
"object": "text_completion",
|
"object": "text_completion",
|
||||||
|
|
Loading…
Reference in a new issue