Skip to content

Commit

Permalink
remove redundant .tolist() (#1419)
Browse files Browse the repository at this point in the history
![image](https://github.com/user-attachments/assets/77013e49-d1bd-4f3a-99aa-1d17e9b8f6b5)


- To fix remove redundant `.tolist()` since it was already done above.

---------

Co-authored-by: Ilya Lavrenov <[email protected]>
  • Loading branch information
pavel-esir and ilya-lavrenov authored Dec 23, 2024
1 parent 2fb56d4 commit 3ed6963
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/llm_bench/task/text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def token_printer():
- np.array(perf_metrics.raw_metrics.m_new_token_times[:-1])
).tolist()

tm_list = np.array([first_token_time] + second_tokens_durations) / 1000
tm_list = (np.array([first_token_time] + second_tokens_durations) / 1000).tolist()
inference_durations = (np.array(perf_metrics.raw_metrics.token_infer_durations) / 1000 / 1000).tolist()
log.debug('latency of all tokens:')
[log.debug('[{}]{:.4f}'.format(idx, tm)) for idx, tm in enumerate(tm_list)]
Expand All @@ -323,8 +323,8 @@ def token_printer():
metrics_print.print_metrics(
num,
iter_data,
tm_list.tolist(),
inference_durations.tolist(),
tm_list,
inference_durations,
warm_up=(num == 0),
max_rss_mem=max_rss_mem_consumption,
max_shared_mem=max_shared_mem_consumption,
Expand Down

0 comments on commit 3ed6963

Please sign in to comment.