From a86f33477d40fb388aca82673fb4548f43f88eb0 Mon Sep 17 00:00:00 2001 From: fxmarty <9808326+fxmarty@users.noreply.github.com> Date: Sat, 12 Aug 2023 00:59:53 +0900 Subject: [PATCH] Fix fp16 ONNX detection for decoder models (#1276) fix fp16 detection --- optimum/onnxruntime/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimum/onnxruntime/base.py b/optimum/onnxruntime/base.py index f5e2776981..f9091650b2 100644 --- a/optimum/onnxruntime/base.py +++ b/optimum/onnxruntime/base.py @@ -152,7 +152,7 @@ def __init__( self.use_fp16 = False for inp in session.get_inputs(): - if inp.name == "past_key_values" and inp.type == "tensor(float16)": + if "past_key_values" in inp.name and inp.type == "tensor(float16)": self.use_fp16 = True break