From 594e2a5f25d871c66b5f77610ebb24efb9dbfb64 Mon Sep 17 00:00:00 2001 From: blackpolarz Date: Fri, 11 Oct 2024 15:19:57 +0800 Subject: [PATCH] New PR: Allow users to add their own customised model without editing existing faster-whisper code Added a function to allow users to add their own Hugging Face ct2 models. Provides a user-friendly way to test other models. --- faster_whisper/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/faster_whisper/utils.py b/faster_whisper/utils.py index 481bd748..88ea275a 100644 --- a/faster_whisper/utils.py +++ b/faster_whisper/utils.py @@ -29,6 +29,12 @@ } +def add_model(model_dict) -> dict: + """Adds a dictionary of custom Models to existing Model""" + _MODELS.update(model_dict) + return _MODELS + + def available_models() -> List[str]: """Returns the names of available models.""" return list(_MODELS.keys())