From 6740db2b8fe0d571b889147df7a2b85edbc3602f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20BREDIN?= Date: Sat, 16 Sep 2023 15:50:40 +0200 Subject: [PATCH] fix(core): fix Model.example_output for embedding models --- pyannote/audio/core/model.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyannote/audio/core/model.py b/pyannote/audio/core/model.py index 5cb6c0e6b..bedb7f6c4 100644 --- a/pyannote/audio/core/model.py +++ b/pyannote/audio/core/model.py @@ -198,12 +198,13 @@ def __example_output( example_output: torch.Tensor, specifications: Specifications = None, ) -> Output: - _, num_frames, dimension = example_output.shape - if specifications.resolution == Resolution.FRAME: + _, num_frames, dimension = example_output.shape frame_duration = specifications.duration / num_frames frames = SlidingWindow(step=frame_duration, duration=frame_duration) else: + _, dimension = example_output.shape + num_frames = None frames = None return Output(