install requirements automatically
| | |
| | | if isinstance(kwargs, DictConfig): |
| | | kwargs = OmegaConf.to_container(kwargs, resolve=True) |
| | | if os.path.exists(os.path.join(model_or_path, "requirements.txt")): |
| | | requirements = os.path.join(model_or_path, "requirements.txt") |
| | | print(f"Detect model requirements, begin to install it: {requirements}") |
| | | from funasr.utils.install_model_requirements import install_requirements |
| | | install_requirements(os.path.join(model_or_path, "requirements.txt")) |
| | | return kwargs |
| | |
| | | from typing import Tuple |
| | | import torch |
| | | import torch.nn as nn |
| | | import whisper |
| | | from whisper.audio import HOP_LENGTH, N_FFT, N_SAMPLES |
| | | |
| | | |
| | | from funasr.register import tables |
| | | from torch.nn.utils.rnn import pad_sequence |
| | | |
| | |
| | | super().__init__() |
| | | assert fs == 16000 |
| | | self.fs = fs |
| | | |
| | | import whisper |
| | | from whisper.audio import HOP_LENGTH, N_FFT, N_SAMPLES |
| | | self.n_fft = N_FFT |
| | | self.win_length = N_FFT |
| | | self.hop_length = HOP_LENGTH |