From 8912e0696af069de47646fdb8a9d9c4e086e88b3 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期日, 14 一月 2024 23:42:11 +0800
Subject: [PATCH] Resolve merge conflict

---
 funasr/models/campplus/model.py |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/funasr/models/campplus/model.py b/funasr/models/campplus/model.py
index 84938cc..25ef3d7 100644
--- a/funasr/models/campplus/model.py
+++ b/funasr/models/campplus/model.py
@@ -109,13 +109,10 @@
         audio_sample_list = load_audio_text_image_video(data_in, fs=16000, audio_fs=kwargs.get("fs", 16000), data_type="sound")
         time2 = time.perf_counter()
         meta_data["load_data"] = f"{time2 - time1:0.3f}"
-        speech, speech_lengths = extract_feature(audio_sample_list)
+        speech, speech_lengths, speech_times = extract_feature(audio_sample_list)
+        speech = speech.to(device=kwargs["device"])
         time3 = time.perf_counter()
         meta_data["extract_feat"] = f"{time3 - time2:0.3f}"
-        meta_data["batch_data_time"] = np.array(speech_lengths).sum().item() / 16000.0
-        # import pdb; pdb.set_trace()
-        results = []
-        embeddings = self.forward(speech)
-        for embedding in embeddings:
-            results.append({"spk_embedding":embedding})
+        meta_data["batch_data_time"] = np.array(speech_times).sum().item() / 16000.0
+        results = [{"spk_embedding": self.forward(speech)}]
         return results, meta_data
\ No newline at end of file

--
Gitblit v1.9.1