From 3cd71a385a31f987f2db99df902ca36ee02b1813 Mon Sep 17 00:00:00 2001
From: 九耳 <mengzhe.cmz@alibaba-inc.com>
Date: 星期四, 30 三月 2023 17:29:12 +0800
Subject: [PATCH] change name

---
 funasr/export/models/modules/multihead_att.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/funasr/export/models/modules/multihead_att.py b/funasr/export/models/modules/multihead_att.py
index 0a56676..1983db8 100644
--- a/funasr/export/models/modules/multihead_att.py
+++ b/funasr/export/models/modules/multihead_att.py
@@ -75,8 +75,10 @@
     return x, cache
 
 
-import torch.fx
-torch.fx.wrap('preprocess_for_attn')
+torch_version = float(".".join(torch.__version__.split(".")[:2]))
+if torch_version >= 1.8:
+    import torch.fx
+    torch.fx.wrap('preprocess_for_attn')
 
 
 class MultiHeadedAttentionSANMDecoder(nn.Module):

--
Gitblit v1.9.1