Skip to content

Commit

Permalink
changing performance metrics according to stream mode:
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisenman23 committed Nov 21, 2024
1 parent dc4579a commit bfdd13f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elm/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ def chat(self, query,
start_completion_time = perf_counter()

response = self._client.chat.completions.create(**kwargs)
finish_completion_time = perf_counter()
chat_completion_time = start_completion_time - finish_completion_time
if return_chat_obj:
return response, query, references
if stream:
Expand All @@ -229,6 +227,8 @@ def chat(self, query,
print(chunk_msg, end='')
else:
response_message = response.choices[0].message.content
finish_completion_time = perf_counter()
chat_completion_time = start_completion_time - finish_completion_time

self.messages.append({'role': 'assistant',
'content': response_message})
Expand Down

0 comments on commit bfdd13f

Please sign in to comment.