Skip to content

Commit

Permalink
ensure generated_tokens is an integer
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Nguyen committed Oct 31, 2023
1 parent 5434a57 commit 6bd5dd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion easyllm/clients/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def create(
message=ChatMessage(role="assistant", content=res["completion"].strip()),
finish_reason=res["stop_reason"],
)
generated_tokens += len(res["completion"].strip()) / 4
generated_tokens += len(res["completion"].strip()) // 4
choices.append(parsed)
logger.debug(f"Response at index {_i}:\n{parsed}")
# calculate usage details
Expand Down

0 comments on commit 6bd5dd7

Please sign in to comment.