Skip to content

Commit

Permalink
OAI: Fix completion token fetching
Browse files Browse the repository at this point in the history
The generator returns generated_tokens in the dict.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Feb 11, 2024
1 parent 7e730e3 commit f627485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OAI/utils/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def create_completion_response(generation: dict, model_name: Optional[str]):
)

prompt_tokens = unwrap(generation.get("prompt_tokens"), 0)
completion_tokens = unwrap(generation.get("completion_tokens"), 0)
completion_tokens = unwrap(generation.get("generated_tokens"), 0)

response = CompletionResponse(
choices=[choice],
Expand Down

0 comments on commit f627485

Please sign in to comment.