From bc36beb0b7fc8aa35ab11928232cef1c24127ef1 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 6 Oct 2024 20:22:00 +0800 Subject: [PATCH] Optimize model loading with cache --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 332aadc..c36ba12 100644 --- a/app.py +++ b/app.py @@ -44,7 +44,7 @@ def load_lottieurl(url: str): ###### ➠ If you want to translate the subtitles to English, select the task as "Translate" ###### I recommend starting with the base model and then experimenting with the larger models, the small and medium models often work well. """) - +@st.cache_resource def change_model(current_size, size): if current_size != size: loaded_model = whisper.load_model(size)