Skip to content

Commit 3ba1057

Browse files
LoSealLecharlaix
andauthored
Fix ModelPatcher returns empty outputs (#2109)
* fix bug `ModelPatcher` returns empty outputs When model's output is tuple or list, `filtered_outputs` doesn't get assigned and hence always a empty dict * typo --------- Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
1 parent f22655c commit 3ba1057

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

optimum/exporters/onnx/model_patcher.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def patched_forward(*args, **kwargs):
168168
filterd_outputs[name] = value
169169
elif isinstance(outputs, (list, tuple)):
170170
outputs_list = list(config.outputs.keys())
171-
dict(zip(outputs_list, outputs))
171+
filterd_outputs = dict(zip(outputs_list, outputs))
172172
else:
173173
if len(config.outputs) > 1:
174174
num_outputs = len(config.outputs)

0 commit comments

Comments
 (0)