From 6ca0d1f54c8b698e3315edab8aa9ba7227d7c9e7 Mon Sep 17 00:00:00 2001
From: wanchen.swc <wanchen.swc@alibaba-inc.com>
Date: 星期四, 16 三月 2023 18:53:57 +0800
Subject: [PATCH] [Quantization] run calib without grad

---
 funasr/export/export_model.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/funasr/export/export_model.py b/funasr/export/export_model.py
index c5bcac1..e57a397 100644
--- a/funasr/export/export_model.py
+++ b/funasr/export/export_model.py
@@ -76,7 +76,8 @@
                 feats, feats_len = self.load_feats(self.audio_in)
                 for i, (feat, len) in enumerate(zip(feats, feats_len)):
                     print("debug, iter: {}".format(i))
-                    m(feat, len)
+                    with torch.no_grad():
+                        m(feat, len)
             else:
                 dummy_input = model.get_dummy_inputs()
                 m(*dummy_input)

--
Gitblit v1.9.1