利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
Python ai-video-generatorcontent-creationffmpeginstagram-reelsllmpythonshort-videosubtitlestext-to-speechtiktokvideo-automationvideo-workflowworkflow-automationyoutube-shorts
compatible with local whisper model
harry1c7d7e138b76
diff --git a/app/services/subtitle.py b/app/services/subtitle.pyindex 5ea80286..d19ac59a 100644--- a/app/services/subtitle.py+++ b/app/services/subtitle.py@@ -1,4 +1,5 @@import json+import os.pathimport refrom faster_whisper import WhisperModel@@ -17,8 +18,13 @@ model = Nonedef create(audio_file, subtitle_file: str = ""):global modelif not model:- logger.info(f"loading model: {model_size}, device: {device}, compute_type: {compute_type}")- model = WhisperModel(model_size_or_path=model_size,+ model_path = f"{utils.root_dir()}/models/whisper-{model_size}"+ model_bin_file = f"{model_path}/model.bin"+ if not os.path.isdir(model_path) or not os.path.isfile(model_bin_file):+ model_path = model_size++ logger.info(f"loading model: {model_path}, device: {device}, compute_type: {compute_type}")+ model = WhisperModel(model_size_or_path=model_path,device=device,compute_type=compute_type)