mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
install requirements automatically
This commit is contained in:
parent
1df10311c4
commit
5942057698
@ -73,6 +73,8 @@ def download_from_ms(**kwargs):
|
||||
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
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
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
|
||||
|
||||
@ -26,7 +26,8 @@ class WhisperFrontend(nn.Module):
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user