Skip to content

Commit

Permalink
Fixing dictionary usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tpfau committed Oct 1, 2024
1 parent 504c141 commit 3e737a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llama_cpp/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -1414,10 +1414,11 @@ def logit_bias_processor(
break

if stream:
if stream_options is None or stream_options.include_usage == None:
include_usage = False
else:
include_usage = stream_options.include_usage
if stream_options is not None and "include_usage" in stream_options:
include_usage = True if stream_options["include_usage"] else False
else:
include_usage = False

remaining_tokens = completion_tokens[returned_tokens:]
remaining_text = self.detokenize(
remaining_tokens,
Expand Down

0 comments on commit 3e737a3

Please sign in to comment.