Skip to content

Commit 774e342

Browse files
authored
Fix segment and reduce block size (#53)
1 parent 27b711e commit 774e342

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

amt/inference/transcribe.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
torch._inductor.config.fx_graph_cache = True
3636

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

299299
results = [
300300
tokenizer.decode(seq[_idx, : eos_idxs[_idx] + 1])

amt/run.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def transcribe(
467467

468468
files_to_process = []
469469
for audio_path in file_paths:
470-
if segments_by_audio_file.get(audio_path, None):
470+
if segments_by_audio_file.get(audio_path, None) is not None:
471471
file_info = {
472472
"path": audio_path,
473473
"segments": segments_by_audio_file[audio_path],

0 commit comments

Comments
 (0)