Skip to content

Commit

Permalink
Update model.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jongwook authored Sep 30, 2024
1 parent 65a3537 commit 3211024
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions whisper/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import gzip
from contextlib import contextmanager
from dataclasses import dataclass
from typing import Dict, Iterable, Optional
from typing import Dict, Iterable, Optional, Tuple

import numpy as np
import torch
Expand Down Expand Up @@ -113,7 +113,7 @@ def forward(

def qkv_attention(
self, q: Tensor, k: Tensor, v: Tensor, mask: Optional[Tensor] = None
) -> tuple[torch.Tensor, Optional[torch.Tensor]]:
) -> Tuple[torch.Tensor, Optional[torch.Tensor]]:
n_batch, n_ctx, n_state = q.shape
scale = (n_state // self.n_head) ** -0.25
q = q.view(*q.shape[:2], self.n_head, -1).permute(0, 2, 1, 3)
Expand Down

0 comments on commit 3211024

Please sign in to comment.