mirror of
https://github.com/openai/whisper.git
synced 2025-03-30 14:28:27 +00:00
invoking __call__ instead of forward()
This commit is contained in:
parent
02aa851a49
commit
eff383b27b
@ -21,6 +21,10 @@ We used Python 3.9.9 and [PyTorch](https://pytorch.org/) 1.10.1 to train and tes
|
||||
|
||||
pip install git+https://github.com/openai/whisper.git
|
||||
|
||||
To update the package to the latest version of this repository, please run:
|
||||
|
||||
pip install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git
|
||||
|
||||
It also requires the command-line tool [`ffmpeg`](https://ffmpeg.org/) to be installed on your system, which is available from most package managers:
|
||||
|
||||
```bash
|
||||
|
@ -214,10 +214,10 @@ class Whisper(nn.Module):
|
||||
)
|
||||
|
||||
def embed_audio(self, mel: torch.Tensor):
|
||||
return self.encoder.forward(mel)
|
||||
return self.encoder(mel)
|
||||
|
||||
def logits(self, tokens: torch.Tensor, audio_features: torch.Tensor):
|
||||
return self.decoder.forward(tokens, audio_features)
|
||||
return self.decoder(tokens, audio_features)
|
||||
|
||||
def forward(self, mel: torch.Tensor, tokens: torch.Tensor) -> Dict[str, torch.Tensor]:
|
||||
return self.decoder(tokens, self.encoder(mel))
|
||||
|
Loading…
x
Reference in New Issue
Block a user