Fix: force native Python bool/float for JSON serialization (numpy types)
This commit is contained in:
parent
8512076b91
commit
33a138af9e
@ -59,7 +59,7 @@ def transcribe_full(audio_path, lang=None, model_size="small"):
|
|||||||
vad_filter=True,
|
vad_filter=True,
|
||||||
)
|
)
|
||||||
detected_lang = info.language
|
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)
|
print(f" Detekcija: {detected_lang} (p={detected_prob:.2f})", file=sys.stderr)
|
||||||
|
|
||||||
segments = []
|
segments = []
|
||||||
@ -351,7 +351,7 @@ def is_instrumental(transcript, video_duration, threshold=0.1):
|
|||||||
s["end"] - s["start"] for s in transcript["segments"]
|
s["end"] - s["start"] for s in transcript["segments"]
|
||||||
)
|
)
|
||||||
ratio = vocal_duration / max(video_duration, 1)
|
ratio = vocal_duration / max(video_duration, 1)
|
||||||
return ratio < threshold
|
return bool(ratio < threshold)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user