Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions hns/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ def _load_model(self) -> WhisperModel:
except Exception as e:
raise RuntimeError(f"Failed to load model: {e}")

def transcribe(
self, audio_source: Union[Path, str], stream_output: bool = False, show_progress: bool = True
) -> str:
def transcribe(self, audio_source: Union[Path, str], show_progress: bool = True) -> str:
transcribe_kwargs = {
"beam_size": 5,
"vad_filter": True,
Expand Down Expand Up @@ -232,8 +230,6 @@ def transcribe_worker():
for segment in segments:
text = segment.text.strip()
if text:
if stream_output:
click.echo(text, nl=False)
transcription_parts.append(text)
progress_queue.put(("result", transcription_parts))
except Exception as e:
Expand Down Expand Up @@ -281,13 +277,8 @@ def transcribe_worker():
for segment in segments:
text = segment.text.strip()
if text:
if stream_output:
click.echo(text, nl=False)
transcription_parts.append(text)

if stream_output and transcription_parts:
click.echo() # New line after streaming

full_transcription = " ".join(transcription_parts)
if not full_transcription:
raise ValueError("No speech detected in audio")
Expand Down