From eba1fccfa07665ed9cada19cfab6cd342e03112e Mon Sep 17 00:00:00 2001
From: Shi Xian <40013335+R1ckShi@users.noreply.github.com>
Date: 星期二, 16 一月 2024 11:34:04 +0800
Subject: [PATCH] Merge pull request #1250 from alibaba-damo-academy/funasr1.0
---
funasr/models/rwkv_bat/rwkv_encoder.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/funasr/models/rwkv_bat/rwkv_encoder.py b/funasr/models/rwkv_bat/rwkv_encoder.py
index 3454299..af702e9 100644
--- a/funasr/models/rwkv_bat/rwkv_encoder.py
+++ b/funasr/models/rwkv_bat/rwkv_encoder.py
@@ -113,12 +113,12 @@
x = self.embed_norm(x)
olens = mask.eq(0).sum(1)
- # for training
- # for block in self.rwkv_blocks:
- # x, _ = block(x)
-
- # for streaming inference
- x = self.rwkv_infer(x)
+ if self.training:
+ for block in self.rwkv_blocks:
+ x, _ = block(x)
+ else:
+ x = self.rwkv_infer(x)
+
x = self.final_norm(x)
if self.time_reduction_factor > 1:
--
Gitblit v1.9.1