Skip to content

Commit

Permalink
fix gpt2 failure (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengniwang95 authored Oct 21, 2022
1 parent 66b60a4 commit aea1219
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions neural_compressor/adaptor/ox_utils/operators/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def convert(self, convert_format):
inputs.extend(quantized_name)
inputs.append(node.input[2])
inputs.extend(scale)
if len(node.input) > 3:
inputs.append(node.input[3])
inputs.append(node.input[3] if len(node.input) > 3 else "")
inputs.extend(zp)
if len(node.input) > 4:
inputs.append(node.input[4])
Expand All @@ -74,4 +73,4 @@ def convert(self, convert_format):
node.name, **kwargs)
self.quantizer.new_nodes.append(qattention_node)

self.quantizer.remove_nodes.append(node)
self.quantizer.remove_nodes.append(node)

0 comments on commit aea1219

Please sign in to comment.