mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 14:35:57 +00:00
Merge 197922dcc02f7345262b6de7c2b231b5693e7f11 into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2
This commit is contained in:
commit
dab005b8f3
@ -50,6 +50,8 @@ _ALIGNMENT_HEADS = {
|
|||||||
"turbo": b"ABzY8j^C+e0{>%RARaKHP%t(lGR*)0g!tONPyhe`",
|
"turbo": b"ABzY8j^C+e0{>%RARaKHP%t(lGR*)0g!tONPyhe`",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ffmpeg_path: str = "ffmpeg"
|
||||||
|
|
||||||
|
|
||||||
def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]:
|
def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]:
|
||||||
os.makedirs(root, exist_ok=True)
|
os.makedirs(root, exist_ok=True)
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import numpy as np
|
|||||||
import torch
|
import torch
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
|
|
||||||
|
import whisper
|
||||||
from .utils import exact_div
|
from .utils import exact_div
|
||||||
|
|
||||||
# hard-coded audio hyperparameters
|
# hard-coded audio hyperparameters
|
||||||
@ -43,7 +44,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE):
|
|||||||
# and resampling as necessary. Requires the ffmpeg CLI in PATH.
|
# and resampling as necessary. Requires the ffmpeg CLI in PATH.
|
||||||
# fmt: off
|
# fmt: off
|
||||||
cmd = [
|
cmd = [
|
||||||
"ffmpeg",
|
whisper.ffmpeg_path,
|
||||||
"-nostdin",
|
"-nostdin",
|
||||||
"-threads", "0",
|
"-threads", "0",
|
||||||
"-i", file,
|
"-i", file,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user