Skip to content

Commit 10f4491

Browse files
authored
Harmonize default parameters in cli/translate and Python methods (#378)
1 parent 13a0ddd commit 10f4491

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cli/translate.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ int main(int argc, char* argv[]) {
2828
("use_vmap", "Use the vocabulary map included in the model to restrict the target candidates.",
2929
cxxopts::value<bool>()->default_value("false"))
3030
("batch_size", "Size of the batch to forward into the model at once.",
31-
cxxopts::value<size_t>()->default_value("30"))
31+
cxxopts::value<size_t>()->default_value("32"))
3232
("read_batch_size", "Size of the batch to read at once (defaults to batch_size).",
3333
cxxopts::value<size_t>()->default_value("0"))
3434
("batch_type", "Batch type (can be examples, tokens).",
3535
cxxopts::value<std::string>()->default_value("examples"))
3636
("beam_size", "Beam search size (set 1 for greedy decoding).",
37-
cxxopts::value<size_t>()->default_value("5"))
37+
cxxopts::value<size_t>()->default_value("2"))
3838
("sampling_topk", "Sample randomly from the top K candidates.",
3939
cxxopts::value<size_t>()->default_value("1"))
4040
("sampling_temperature", "Sampling temperature.",

docs/python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ output = translator.translate_batch(
7878
stats = translator.translate_file(
7979
input_path: str, # Input file.
8080
output_path: str, # Output file.
81-
max_batch_size: int, # Maximum batch size to run the model on.
81+
max_batch_size: int = 32, # Maximum batch size to run the model on.
8282
read_batch_size: int = 0, # Number of sentences to read at once.
8383
batch_type: str = "examples", # Whether the batch size is the number of examples or tokens.
8484
beam_size: int = 2,

python/translator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ PYBIND11_MODULE(translator, m)
370370
.def("translate_file", &TranslatorWrapper::translate_file,
371371
py::arg("input_path"),
372372
py::arg("output_path"),
373-
py::arg("max_batch_size"),
373+
py::arg("max_batch_size")=32,
374374
py::arg("read_batch_size")=0,
375375
py::arg("batch_type")="examples",
376376
py::arg("beam_size")=2,

0 commit comments

Comments
 (0)