Fix clip_timestamps format, Windows UTF-8 console, and non-dict LLM response#4
Open
Ahmed-Ezzat20 wants to merge 1 commit into
Open
Fix clip_timestamps format, Windows UTF-8 console, and non-dict LLM response#4Ahmed-Ezzat20 wants to merge 1 commit into
Ahmed-Ezzat20 wants to merge 1 commit into
Conversation
…esponse - faster-whisper: convert clip_timestamps to flat list of seconds [start1, end1, ...] instead of list of dicts, fixing TypeError in BatchedInferencePipeline.transcribe() - cli: reconfigure stdout/stderr to UTF-8 on Windows to prevent UnicodeEncodeError on non-Latin project names - describe: guard against json_repair.loads() returning a non-dict (e.g. list or string) from small/local LLMs
4f62228 to
33e5741
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three bug fixes discovered during end-to-end testing of the pipeline:
1.
clip_timestampsformat bug (faster-whisper backend)_transcribe_faster_whisper()passesspeech_clips_secas a list of dicts ([{"start": 0.5, "end": 3.2}, ...]) toclip_timestamps, butBatchedInferencePipeline.transcribe()expects a flat list of seconds ([0.5, 3.2, ...]). This causes aTypeErrorat runtime.Fix: Convert to flat
[start1, end1, start2, end2, ...]format.2. Windows console UnicodeEncodeError
On Windows,
sys.stdoutdefaults tocp1252encoding, which cannot represent Arabic, CJK, or other non-Latin characters. Anyprint()or log message containing a non-Latin project slug (e.g.مين-هو-مستر-عزت) crashes withUnicodeEncodeError.Fix: Reconfigure
stdout/stderrto UTF-8 witherrors="replace"at CLI entry point, guarded bysys.platform == "win32".3.
describe.pycrash on non-dict LLM responsejson_repair.loads()can return a list, string, orNonewhen small/local LLMs (e.g. Ollamaqwen3:4b) produce malformed JSON. The subsequent.get()call crashes withAttributeError: 'list' object has no attribute 'get'.Fix: Guard with
isinstance(description, dict)check, wrapping non-dict responses into the expected schema.Test plan
--method faster-whisper(requires GPU or CPU with the model)describestage with a small local LLM (e.g. Ollama qwen3:4b)