HyperPyYAML icon indicating copy to clipboard operation
HyperPyYAML copied to clipboard

Cannot include documents with object `!ref`s

Open pplantinga opened this issue 3 years ago • 4 comments

Right now, the !include tag first resolves references in the included document (turning objects into anchors like *id001) the names of which collide with any references in the original document.

pplantinga avatar Mar 23 '21 12:03 pplantinga

Same here. I wish to !include a yaml file based on the dataset name but it is not working.

dataset_name: TIMIT dataset_yaml: !ref ../datasets/<dataset_name>/dataset.yaml dataset: !include:!ref <dataset_yaml>

weiwei-ww avatar Nov 09 '21 11:11 weiwei-ww

@pplantinga, is there a fix for that?

mravanelli avatar Nov 09 '21 15:11 mravanelli

The issue @weiwei-ww has brought up is actually a separate issue. In this case, what is desired is the dereference to happen before the include. In fact, the !include was designed to take place before the dereference so that items in the included file can also be referenced.

pplantinga avatar Nov 09 '21 15:11 pplantinga

The issue @weiwei-ww has brought up is actually a separate issue. In this case, what is desired is the dereference to happen before the include. In fact, the !include was designed to take place before the dereference so that items in the included file can also be referenced.

Yes, that is exactly what I was proposing. I wish to have a single code entrance (e.g. train.py), with model names (e.g. CTC) given by command line arguments. Then the corresponding yaml file for that model (e.g. models/CTC/hparams/train.yaml) will be loaded automatically.

weiwei-ww avatar Nov 09 '21 18:11 weiwei-ww