mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
from local
This commit is contained in:
parent
de2a41d86c
commit
95c3d5b854
Binary file not shown.
@ -913,12 +913,21 @@ def compute_loss(
|
||||
if decode:
|
||||
model.eval()
|
||||
with torch.no_grad():
|
||||
hypos = model.module.decode(
|
||||
x=feature,
|
||||
x_lens=feature_lens,
|
||||
y=y,
|
||||
sp=sp
|
||||
)
|
||||
try:
|
||||
hypos = model.module.decode(
|
||||
x=feature,
|
||||
x_lens=feature_lens,
|
||||
y=y,
|
||||
sp=sp
|
||||
)
|
||||
except:
|
||||
hypos = model.decode(
|
||||
x=feature,
|
||||
x_lens=feature_lens,
|
||||
y=y,
|
||||
sp=sp
|
||||
)
|
||||
|
||||
logging.info(f'ref: {batch["supervisions"]["text"][0]}')
|
||||
logging.info(f'hyp: {" ".join(hypos[0])}')
|
||||
model.train()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user