Fix: force native Python bool/float for JSON serialization (numpy types)

This commit is contained in:
Sebastjan Artič 2026-04-29 06:23:41 +00:00
parent 8512076b91
commit 33a138af9e

View File

@ -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():