chore: backup before migration to new repo
This commit is contained in:
@@ -65,12 +65,20 @@ def run_asr(video_path, output_path, uuid: str = ""):
|
||||
if publisher:
|
||||
publisher.info("asr", "Loading Whisper model...")
|
||||
|
||||
model = WhisperModel("tiny", device="cpu", compute_type="int8")
|
||||
# Use small model with CPU (MPS not supported by faster_whisper)
|
||||
# small 模型在準確率和速度間取得最佳平衡
|
||||
model = WhisperModel("small", device="cpu", compute_type="int8")
|
||||
|
||||
if publisher:
|
||||
publisher.info("asr", f"Transcribing: {video_path}")
|
||||
|
||||
segments, info = model.transcribe(video_path, beam_size=5)
|
||||
# Transcribe with VAD filter for better accuracy
|
||||
segments, info = model.transcribe(
|
||||
video_path,
|
||||
beam_size=5,
|
||||
vad_filter=True,
|
||||
vad_parameters=dict(min_silence_duration_ms=500, speech_pad_ms=200),
|
||||
)
|
||||
|
||||
if publisher:
|
||||
publisher.info("asr", f"ASR_LANGUAGE:{info.language}")
|
||||
|
||||
Reference in New Issue
Block a user