From da2ff3cd5bef04287600105d856147e65685321a Mon Sep 17 00:00:00 2001 From: Jean Senellart Date: Thu, 28 Dec 2017 21:46:04 +0100 Subject: fix #476 (#477) * fix #476: default value of model_config points to existing file --- docs/tools/servers.md | 2 +- test/data/rest_config.yml | 17 +++++++++++++++++ tools/rest_multi_models.lua | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 test/data/rest_config.yml diff --git a/docs/tools/servers.md b/docs/tools/servers.md index 3f9781db..020e94cb 100644 --- a/docs/tools/servers.md +++ b/docs/tools/servers.md @@ -61,7 +61,7 @@ Here is an example with two models: beam_size: 5 ``` -By default, it uses the file in tools/rest_config.yml but you can modify with `--mode_config the location`. +By default, it uses the file in `test/data/rest_config.yml` but you can modify with `--mode_config the location`. ```bash diff --git a/test/data/rest_config.yml b/test/data/rest_config.yml new file mode 100644 index 00000000..ee34af5c --- /dev/null +++ b/test/data/rest_config.yml @@ -0,0 +1,17 @@ +- + model: '/NMTModels/en-fr/model-enfr_epoch600_3.03.t7' + replace_unk: true + mode: aggressive + joiner_annotate: true + case_feature: true + segment_case: true + beam_size: 5 + +- + model: '/NMTModels/en-it/model-enit_epoch600_4.17.t7' + replace_unk: true + mode: aggressive + joiner_annotate: true + case_feature: true + segment_case: true + beam_size: 5 diff --git a/tools/rest_multi_models.lua b/tools/rest_multi_models.lua index 283b25e8..3d421bc0 100644 --- a/tools/rest_multi_models.lua +++ b/tools/rest_multi_models.lua @@ -43,7 +43,7 @@ local server_options = { [[Unload unused model from memory after this time.]] }, { - '-model_config', 'tools/rest_config.yml', + '-model_config', 'test/data/rest_config.yml', [[Path to yaml configuration file.]], { valid = onmt.utils.ExtendedCmdLine.fileExists -- cgit v1.2.3