Skip to content

Commit

Permalink
fix(core): fix Model.example_output for embedding models
Browse files Browse the repository at this point in the history
  • Loading branch information
hbredin committed Sep 16, 2023
1 parent b660b1e commit 9df6944
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyannote/audio/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9df6944

Please sign in to comment.