From ff83116369ba6afe56430cb0b9d977fbe7f4bced Mon Sep 17 00:00:00 2001
From: Atomie CHEN <atomic_cwh@163.com>
Date: 星期一, 25 三月 2024 09:37:26 +0800
Subject: [PATCH] fix: resolve IndexError when using spk model and the audio contains only 1 segment (#1535)

---
 funasr/train_utils/average_nbest_models.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/funasr/train_utils/average_nbest_models.py b/funasr/train_utils/average_nbest_models.py
index f117804..3603a44 100644
--- a/funasr/train_utils/average_nbest_models.py
+++ b/funasr/train_utils/average_nbest_models.py
@@ -143,7 +143,7 @@
     return checkpoint_paths
 
 @torch.no_grad()
-def average_checkpoints(output_dir: str, last_n: int=5):
+def average_checkpoints(output_dir: str, last_n: int=5, val_acc_list=[]):
     """
     Average the last 'last_n' checkpoints' model state_dicts.
     If a tensor is of type torch.int, perform sum instead of average.

--
Gitblit v1.9.1