Skip to content

Commit

Permalink
Fix fp16 ONNX detection for decoder models (#1276)
Browse files Browse the repository at this point in the history
fix fp16 detection
  • Loading branch information
fxmarty authored Aug 11, 2023
1 parent 3dfae0c commit a86f334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/onnxruntime/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a86f334

Please sign in to comment.