diff --git a/llama_cpp/llama.py b/llama_cpp/llama.py index fdde7ea01..b43a354b3 100644 --- a/llama_cpp/llama.py +++ b/llama_cpp/llama.py @@ -1228,20 +1228,6 @@ def _create_completion( } ], } - yield { - "id": completion_id, - "object": "text_completion", - "created": created, - "model": model_name, - "choices": [ - { - "text": "", - "index": 0, - "logprobs": None, - "finish_reason": finish_reason, - } - ], - } break returned_tokens += 1 yield { @@ -1260,20 +1246,20 @@ def _create_completion( } ], } - yield { - "id": completion_id, - "object": "text_completion", - "created": created, - "model": model_name, - "choices": [ - { - "text": "", - "index": 0, - "logprobs": None, - "finish_reason": finish_reason, - } - ], - } + yield { + "id": completion_id, + "object": "text_completion", + "created": created, + "model": model_name, + "choices": [ + { + "text": "", + "index": 0, + "logprobs": None, + "finish_reason": finish_reason, + } + ], + } if self.cache: if self.verbose: print("Llama._create_completion: cache save", file=sys.stderr)