Skip to content

Commit

Permalink
Added support for config files (#402)
Browse files Browse the repository at this point in the history
* Partially reverted 5a3bf5f

* Added support for config files

Specify a config file with --config. Command line parameters have
precedence over the values read from the config file, as expected.

The config file is a json serialization of the namespace returned by
argparse, casted to a dictionary. The file args.json produced by the
training can be used as config file.

The config file does not need to be complete. Missing parameters will
be read from the command line or will take default values.

Additionally the functionality introduced in 5a3bf5f has been
reimplemented, accessing the argument_definitions member of
ConfigArgumentParser.

* Added unit tests for config files

* Addressed (most of) github comments

* switch from json to yaml

* changelog, minor version

* Changed config file format to YAML

* Typo

* mypi

* Added test overwriting config file argument with command line
  • Loading branch information
David Vilar authored and fhieber committed May 19, 2018
1 parent 80ac270 commit 948e4ec
Show file tree
Hide file tree
Showing 7 changed files with 999 additions and 889 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ Note that Sockeye has checks in place to not translate with an old model that wa

Each version section may have have subsections for: _Added_, _Changed_, _Removed_, _Deprecated_, and _Fixed_.

## [1.18.13]
### Added
- Added support for config files. Command line parameters have precedence over the values read from the config file.
Minimal working example:
`python -m sockeye.train --config config.yaml` with contents of `config.yaml` as follows:
```yaml
source: source.txt
target: target.txt
output: out
validation_source: valid.source.txt
validation_target: valid.target.txt
```
### Changed
The full set of arguments is serialized to `out/args.yaml` at the beginning of training (before json was used).

## [1.18.12]
### Changed
- All source side sequences now get appended an additional end-of-sentence (EOS) symbol. This change is backwards
Expand Down
2 changes: 1 addition & 1 deletion sockeye/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

__version__ = '1.18.12'
__version__ = '1.18.13'
Loading

0 comments on commit 948e4ec

Please sign in to comment.