Skip to content

Commit 59d3e7a

Browse files
authored
stats : timing values could be null (NaN, inf) (#87)
1 parent 12f9455 commit 59d3e7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

autoload/llama.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,12 +890,12 @@ function! s:fim_render(pos_x, pos_y, data)
890890
if has_key(l:response, 'timings/prompt_n') && has_key(l:response, 'timings/prompt_ms') && has_key(l:response, 'timings/prompt_per_second')
891891
\ && has_key(l:response, 'timings/predicted_n') && has_key(l:response, 'timings/predicted_ms') && has_key(l:response, 'timings/predicted_per_second')
892892
let l:n_prompt = get(l:response, 'timings/prompt_n', 0)
893-
let l:t_prompt_ms = get(l:response, 'timings/prompt_ms', 1)
894-
let l:s_prompt = get(l:response, 'timings/prompt_per_second', 0)
893+
let l:t_prompt_ms = str2float(get(l:response, 'timings/prompt_ms', '1.0'))
894+
let l:s_prompt = str2float(get(l:response, 'timings/prompt_per_second', '0.0'))
895895

896896
let l:n_predict = get(l:response, 'timings/predicted_n', 0)
897-
let l:t_predict_ms = get(l:response, 'timings/predicted_ms', 1)
898-
let l:s_predict = get(l:response, 'timings/predicted_per_second', 0)
897+
let l:t_predict_ms = str2float(get(l:response, 'timings/predicted_ms', '1.0'))
898+
let l:s_predict = str2float(get(l:response, 'timings/predicted_per_second', '0.0'))
899899
endif
900900

901901
let l:has_info = v:true

0 commit comments

Comments
 (0)