From 6c467e6f0abfc6d20d0621fbbf67b4dbd81776cc Mon Sep 17 00:00:00 2001
From: Shi Xian <40013335+R1ckShi@users.noreply.github.com>
Date: 星期二, 18 六月 2024 10:01:56 +0800
Subject: [PATCH] Merge pull request #1825 from modelscope/dev_libt

---
 funasr/models/sanm/attention.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/funasr/models/sanm/attention.py b/funasr/models/sanm/attention.py
index 08f7dc7..c7e8a8e 100644
--- a/funasr/models/sanm/attention.py
+++ b/funasr/models/sanm/attention.py
@@ -780,7 +780,7 @@
         return q, k, v
 
     def forward_attention(self, value, scores, mask, ret_attn):
-        scores = scores + mask
+        scores = scores + mask.to(scores.device)
 
         self.attn = torch.softmax(scores, dim=-1)
         context_layer = torch.matmul(self.attn, value)  # (batch, head, time1, d_k)

--
Gitblit v1.9.1