From 33a138af9edd8db4a5b8e50377701464e31913e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastjan=20Arti=C4=8D?= Date: Wed, 29 Apr 2026 06:23:41 +0000 Subject: [PATCH] Fix: force native Python bool/float for JSON serialization (numpy types) --- scripts/analyze.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/analyze.py b/scripts/analyze.py index b21ad8b..1411526 100644 --- a/scripts/analyze.py +++ b/scripts/analyze.py @@ -59,7 +59,7 @@ def transcribe_full(audio_path, lang=None, model_size="small"): vad_filter=True, ) detected_lang = info.language - detected_prob = info.language_probability + detected_prob = float(info.language_probability) print(f" Detekcija: {detected_lang} (p={detected_prob:.2f})", file=sys.stderr) segments = [] @@ -351,7 +351,7 @@ def is_instrumental(transcript, video_duration, threshold=0.1): s["end"] - s["start"] for s in transcript["segments"] ) ratio = vocal_duration / max(video_duration, 1) - return ratio < threshold + return bool(ratio < threshold) def main():