Skip to content

Commit

Permalink
Harmonize default parameters in cli/translate and Python methods (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumekln authored Jan 13, 2021
1 parent 13a0ddd commit 10f4491
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cli/translate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ int main(int argc, char* argv[]) {
("use_vmap", "Use the vocabulary map included in the model to restrict the target candidates.",
cxxopts::value<bool>()->default_value("false"))
("batch_size", "Size of the batch to forward into the model at once.",
cxxopts::value<size_t>()->default_value("30"))
cxxopts::value<size_t>()->default_value("32"))
("read_batch_size", "Size of the batch to read at once (defaults to batch_size).",
cxxopts::value<size_t>()->default_value("0"))
("batch_type", "Batch type (can be examples, tokens).",
cxxopts::value<std::string>()->default_value("examples"))
("beam_size", "Beam search size (set 1 for greedy decoding).",
cxxopts::value<size_t>()->default_value("5"))
cxxopts::value<size_t>()->default_value("2"))
("sampling_topk", "Sample randomly from the top K candidates.",
cxxopts::value<size_t>()->default_value("1"))
("sampling_temperature", "Sampling temperature.",
Expand Down
2 changes: 1 addition & 1 deletion docs/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ output = translator.translate_batch(
stats = translator.translate_file(
input_path: str, # Input file.
output_path: str, # Output file.
max_batch_size: int, # Maximum batch size to run the model on.
max_batch_size: int = 32, # Maximum batch size to run the model on.
read_batch_size: int = 0, # Number of sentences to read at once.
batch_type: str = "examples", # Whether the batch size is the number of examples or tokens.
beam_size: int = 2,
Expand Down
2 changes: 1 addition & 1 deletion python/translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ PYBIND11_MODULE(translator, m)
.def("translate_file", &TranslatorWrapper::translate_file,
py::arg("input_path"),
py::arg("output_path"),
py::arg("max_batch_size"),
py::arg("max_batch_size")=32,
py::arg("read_batch_size")=0,
py::arg("batch_type")="examples",
py::arg("beam_size")=2,
Expand Down

0 comments on commit 10f4491

Please sign in to comment.