OpenNMT Forum

What's wrong with my YAML configuration file?

I am following the QuickStart (GitHub - OpenNMT/OpenNMT-py: Open Source Neural Machine Translation in PyTorch) tutorial Step 1: Prepare the data, I build a YAML configuration file to specify the data that will be used:(as the following)截屏2021-03-02下午6.58.54
I build toy_en_de.yaml through command “$vi toy_en_de.yaml”.
but when i am trying to build the vocab(s) that will be necessary to train the model, using yaml config file it is showing below error:
onmt_build_vocab: error: Couldn’t parse config file: while parsing a block mapping
in “toy_en_de.yaml”, line 4, column 1
expected , but found ‘’
in “toy_en_de.yaml”, line 12, column 2

How can I fix this?
Thanks in advance!

Probably the ... at the end that are causing the parser to fail. These ... are supposed to mean that the config file can be completed with other stuff, but are not valid yaml.
We should probably make this a bit clearer in the tutorial.

This might help:

1 Like

You mean these"…" refer to other statements, but not print them out completely! Where can I find them further? How can I fix it? Thanks a lot!

I said you could add more to the configuration, not that you had to.
This ellipsis is basically to show that you don’t need the whole training config (added in Step 2) to build the vocab.
How to make it work:
Step 1: remove the ... and run
Step 2: append the additional training config to your existing config and run.