From 85cf8c66967c2e1f8181ec4ff4d54b6cd26e21f9 Mon Sep 17 00:00:00 2001
From: hnluo <haoneng.lhn@alibaba-inc.com>
Date: 星期一, 03 四月 2023 14:19:53 +0800
Subject: [PATCH] Merge pull request #323 from alibaba-damo-academy/dev_lhn2
---
funasr/lm/espnet_model.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/funasr/lm/espnet_model.py b/funasr/lm/espnet_model.py
index 4fc3b49..db11b67 100644
--- a/funasr/lm/espnet_model.py
+++ b/funasr/lm/espnet_model.py
@@ -46,10 +46,10 @@
# 1. Create a sentence pair like '<sos> w1 w2 w3' and 'w1 w2 w3 <eos>'
# text: (Batch, Length) -> x, y: (Batch, Length + 1)
- x = F.pad(text, [1, 0], "constant", self.eos)
+ x = F.pad(text, [1, 0], "constant", self.sos)
t = F.pad(text, [0, 1], "constant", self.ignore_id)
for i, l in enumerate(text_lengths):
- t[i, l] = self.sos
+ t[i, l] = self.eos
x_lengths = text_lengths + 1
# 2. Forward Language model
--
Gitblit v1.9.1