INNER CODE UNIT · Python
mean_ratio
Ki6an/fastT5 · fastT5/model_testing_tools.py:83
mean_ratio = mean_y / mean_x
print(f"seqL : {i}, onnx-{b-a}, pt-{d-c} .. X faster {(d-c)/(b-a)}")
# ...bleu_score-{bleu.compute(predictions=, references=[[tokenizer.decode(o.squeeze(), skip_special_tokens=True)], ])}')
# print(f'o---{tokenizer.decode(out.squeeze(), skip_special_tokens=True)}...p---{tokenizer.decode(o.squeeze(), skip_special_tokens=True)}')
if (o.shape[1] == prev[-1]) and (o.shape[1] == prev[-2]):
break
prev.append(o.shape[1])
print(f"beam no.- {j} onnx-{mean_x} pt-{mean_y} X ratio-{mean_ratio}")
xx.append(x)
yy.append(y)
plt.plot(x, "g", y, "r")
plt.pause(0.05)