From d9e5ee904417ea70e4a9c021be40f5e37f1b5f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xingchen=20Song=28=E5=AE=8B=E6=98=9F=E8=BE=B0=29?= Date: Wed, 24 Apr 2024 09:12:55 +0800 Subject: [PATCH] [onnx] clone weight for whisper (#2501) --- wenet/utils/init_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wenet/utils/init_model.py b/wenet/utils/init_model.py index 309b4d67f6..ce8c12eeaf 100644 --- a/wenet/utils/init_model.py +++ b/wenet/utils/init_model.py @@ -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