Skip to content

Commit

Permalink
fix segment and reduce block size
Browse files Browse the repository at this point in the history
  • Loading branch information
loubbrad committed Aug 30, 2024
1 parent 27b711e commit 2e12a0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions amt/inference/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
torch._inductor.config.fx_graph_cache = True

MAX_SEQ_LEN = 4096
MAX_BLOCK_LEN = 4096
MAX_BLOCK_LEN = 2048
LEN_MS = 30000
STRIDE_FACTOR = 3
CHUNK_LEN_MS = LEN_MS // STRIDE_FACTOR
Expand Down Expand Up @@ -294,7 +294,7 @@ def process_segments(
# to make sure that a sequence of the correct format is returned. Right now
# it messes things up somehow
if not all(_idx <= idx for _idx in eos_idxs):
logger.warning("Context length overflow when transcribing segment")
logger.warning("Context length overflow when transcribing segment(s)")

results = [
tokenizer.decode(seq[_idx, : eos_idxs[_idx] + 1])
Expand Down
2 changes: 1 addition & 1 deletion amt/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def transcribe(

files_to_process = []
for audio_path in file_paths:
if segments_by_audio_file.get(audio_path, None):
if segments_by_audio_file.get(audio_path, None) is not None:
file_info = {
"path": audio_path,
"segments": segments_by_audio_file[audio_path],
Expand Down

0 comments on commit 2e12a0e

Please sign in to comment.