Skip to content

Commit

Permalink
Merge pull request #134 from rmusser01/dev
Browse files Browse the repository at this point in the history
Update Audio_Transcription_Lib.py
  • Loading branch information
rmusser01 authored Jul 28, 2024
2 parents b6535be + c14f8b5 commit a288875
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion App_Function_Libraries/Audio_Transcription_Lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
processing_choice = config.get('Processing', 'processing_choice', fallback='cpu')


# FIXME: This is a temporary solution.
# This doesn't clear older models, which means potentially a lot of memory is being used...
def get_whisper_model(model_name, device):
global whisper_model_instance
if whisper_model_instance is None or whisper_model_instance.model_size != model_name:
if whisper_model_instance is None:
from faster_whisper import WhisperModel
logging.info(f"Initializing new WhisperModel with size {model_name} on device {device}")
whisper_model_instance = WhisperModel(model_name, device=device)
Expand Down

0 comments on commit a288875

Please sign in to comment.