Skip to content

Commit

Permalink
[onnx] clone weight for whisper (#2501)
Browse files Browse the repository at this point in the history
  • Loading branch information
xingchensong authored Apr 24, 2024
1 parent cb65678 commit d9e5ee9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wenet/utils/init_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def init_model(args, configs):

# Tie emb.weight to decoder.output_layer.weight
if model.decoder.tie_word_embedding:
if not hasattr(args, 'jit'):
args.jit = True # i.e. export onnx/jit/ipex
model.decoder.tie_or_clone_weights(jit_mode=args.jit)

return model, configs

0 comments on commit d9e5ee9

Please sign in to comment.