Skip to content

Commit

Permalink
Rename --chunk-size from translate_remote to --aws-batch-chunk-size t…
Browse files Browse the repository at this point in the history
…o avoid conflict with newly introduced --chunk-size flag from translate.py

cr https://cr.amazon.com/r/7923132/
  • Loading branch information
fhieber committed Nov 3, 2017
1 parent 5afa187 commit 4fcb71b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sockeye/translate_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main():

command = sys.argv[1:]

if args.chunk_size > 0:
if args.aws_batch_chunk_size > 0:
_batch_translation(args, command)
else:
command = 'python3 -m sockeye.translate ' + sockeye.utils_remote.remove_aws_args(command)
Expand Down Expand Up @@ -121,8 +121,8 @@ def _batch_translation(args, command):

def _start_jobs(args, batch_client, command, input_arg_index, job_ids, logger, output_arg_index, source_data, temp_dir,
temp_job_def_name):
for i, input_chunk in enumerate(_input_chunks(source_data, args.chunk_size)):
logger.info("Splitting input -- line %d", i * args.chunk_size)
for i, input_chunk in enumerate(_input_chunks(source_data, args.aws_batch_chunk_size)):
logger.info("Splitting input -- line %d", i * args.aws_batch_chunk_size)
with sockeye.data_io.smart_open(_chunk_file_name(temp_dir, "input", i), mode="w") as input_chunk_file:
for line in input_chunk:
input_chunk_file.write(line)
Expand Down
4 changes: 2 additions & 2 deletions sockeye/utils_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def add_aws_args(params):

def add_aws_translation_args(params):
aws_args = params.add_argument_group("AWS Batch Translation Parameters")
aws_args.add_argument('--chunk-size',
aws_args.add_argument('--aws-batch-chunk-size',
default=0,
type=int,
help='x>0: Number of input sentences per chunk. '
Expand All @@ -224,7 +224,7 @@ def remove_aws_args(command: List[str]) -> str:
_remove_argument("--job-queue-name", command)
_remove_argument("--efs-name", command)
_remove_argument("--temp-dir", command)
_remove_argument("--chunk-size", command)
_remove_argument("--aws-batch-chunk-size", command)
_remove_argument("--notify-topic-arn", command)
_remove_argument("--notify-task-name", command)
return " ".join(command)
Expand Down

0 comments on commit 4fcb71b

Please sign in to comment.