parent
2c8a9aaf0d
commit
be5836bee1
1 changed files with 12 additions and 7 deletions
|
|
@ -30,6 +30,10 @@ def highlight_vals(val, max=3.0, color1='red', color2='green'):
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
def nonzero_min(lst):
|
||||||
|
non_zero_lst = [num for num in lst if num >= 0.0]
|
||||||
|
return min(non_zero_lst) if non_zero_lst else None
|
||||||
|
|
||||||
def is_diffs_within_normal_range(diff1, diff2, threshold=5.0):
|
def is_diffs_within_normal_range(diff1, diff2, threshold=5.0):
|
||||||
return not any(diff < (-threshold) for diff in diff1 + diff2 if isinstance(diff, float))
|
return not any(diff < (-threshold) for diff in diff1 + diff2 if isinstance(diff, float))
|
||||||
|
|
||||||
|
|
@ -40,8 +44,8 @@ def add_to_dict(dict, key, value):
|
||||||
|
|
||||||
def best_in_dict(dict, key, value):
|
def best_in_dict(dict, key, value):
|
||||||
if key in dict:
|
if key in dict:
|
||||||
best_value=min(dict[key])
|
best_value = nonzero_min(dict[key])
|
||||||
if best_value < value:
|
if best_value < value or value <= 0.0:
|
||||||
return best_value
|
return best_value
|
||||||
return value
|
return value
|
||||||
return value
|
return value
|
||||||
|
|
@ -129,6 +133,7 @@ def main():
|
||||||
|
|
||||||
previous_1st_token_latency=previous_csv_row[latency_1st_token]
|
previous_1st_token_latency=previous_csv_row[latency_1st_token]
|
||||||
previous_2_avg_latency=previous_csv_row[latency_2_avg]
|
previous_2_avg_latency=previous_csv_row[latency_2_avg]
|
||||||
|
if previous_1st_token_latency > 0.0 and previous_2_avg_latency > 0.0:
|
||||||
last1[latest_csv_ind]=previous_1st_token_latency
|
last1[latest_csv_ind]=previous_1st_token_latency
|
||||||
diff1[latest_csv_ind]=round((previous_1st_token_latency-latest_1st_token_latency)*100/previous_1st_token_latency,2)
|
diff1[latest_csv_ind]=round((previous_1st_token_latency-latest_1st_token_latency)*100/previous_1st_token_latency,2)
|
||||||
last2[latest_csv_ind]=previous_2_avg_latency
|
last2[latest_csv_ind]=previous_2_avg_latency
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue