This commit is contained in:
Yuta Hayashibe 2022-09-23 22:13:25 +09:00
parent 3725694cbb
commit 8ea7b59eed
2 changed files with 3 additions and 4 deletions

View file

@ -2,8 +2,7 @@
import argparse import argparse
import queue import queue
import sys from logging import DEBUG, INFO, basicConfig, getLogger
from logging import DEBUG, INFO, StreamHandler, basicConfig, getLogger
from typing import Optional, Union from typing import Optional, Union
import sounddevice as sd import sounddevice as sd

View file

@ -1,11 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from logging import INFO, getLogger from logging import getLogger
from typing import Iterator, List, Optional, Union from typing import Iterator, List, Optional, Union
import numpy as np import numpy as np
import torch import torch
from transformers.utils.dummy_pt_objects import OPT_PRETRAINED_MODEL_ARCHIVE_LIST
from whisper import Whisper, load_model from whisper import Whisper, load_model
from whisper.audio import ( from whisper.audio import (
HOP_LENGTH, HOP_LENGTH,
@ -255,5 +254,6 @@ class WhisperStreamingTranscriber:
if rest_start is None: if rest_start is None:
return return
logger.debug(f"rest_start={rest_start}")
self.buffer_mel = mel[:, :, rest_start:] self.buffer_mel = mel[:, :, rest_start:]
del mel del mel