From afd7cce0bb73a852baeacbb0921520f89113a443 Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Wed, 12 Feb 2025 00:30:32 +0800 Subject: [PATCH] Avoid overwrite existing custom fields in dnsmos annotation. (#1450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid overwritten existing custom fields in dnsmos annotation. Co-authored-by: Piotr Żelasko --- lhotse/workflows/dnsmos.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lhotse/workflows/dnsmos.py b/lhotse/workflows/dnsmos.py index 1270212c3..7a119ce2a 100644 --- a/lhotse/workflows/dnsmos.py +++ b/lhotse/workflows/dnsmos.py @@ -209,5 +209,8 @@ def _annotate_cuts( for future in tqdm(futures, desc="Processing"): cut, result = future.result() - new_cut = fastcopy(cut, custom=result) - yield new_cut + if cut.custom is not None: + cut.custom.update(result) + else: + cut.custom = result + yield cut