Support VAD filter (#95)
* Support VAD filter * Generalize function collect_samples * Define AudioSegment class * Only pass prompt and prefix to the first chunk * Add dict argument vad_parameters * Fix isort format * Rename method * Update README * Add shortcut when the chunk offset is 0 * Reword readme * Fix end property * Concatenate the speech chunks * Cleanup diff * Increase default speech pad * Update README * Increase default speech pad
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import huggingface_hub
|
||||
@@ -18,6 +20,11 @@ _MODELS = (
|
||||
)
|
||||
|
||||
|
||||
def get_assets_path():
|
||||
"""Returns the path to the assets directory."""
|
||||
return os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets")
|
||||
|
||||
|
||||
def download_model(size: str, output_dir: Optional[str] = None):
|
||||
"""Downloads a CTranslate2 Whisper model from the Hugging Face Hub.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user