Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/OpenNMT/OpenNMT.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Senellart <jean@senellart.com>2017-12-28 23:46:04 +0300
committerGitHub <noreply@github.com>2017-12-28 23:46:04 +0300
commitda2ff3cd5bef04287600105d856147e65685321a (patch)
tree568bce3322126b2d34f595bf22c6730a0774d028
parent9ca5448503ce2fc6d0bcf61f6015998269620ee2 (diff)
fix #476 (#477)
* fix #476: default value of model_config points to existing file
-rw-r--r--docs/tools/servers.md2
-rw-r--r--test/data/rest_config.yml17
-rw-r--r--tools/rest_multi_models.lua2
3 files changed, 19 insertions, 2 deletions
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