[Python] Hydra: Referring to a config group option in the parent directory

Discussão em 'Python' iniciado por Stack, Março 20, 2025.

  1. Stack

    Stack Membro Participativo

    I can't find a way to load config group options from parent directories in hydra. E.g. here I want to load the config group option from datamodule/wikipedia1m.yaml from variant/default.yaml but it does not give what I expected.

    Here are my hydra setup:


    conf
    ├── config.yaml
    ├── datamodule
    │ ├── dummy.yaml
    │ └── wikipedia1m.yaml
    ├── task
    │ ├── concat_t5_base.yaml
    │ ├── concat.yaml
    └── variant
    └── default.yaml


    config.yaml

    defaults:
    - variant: default
    - _self_


    variant/default.yaml

    # @package _global_

    task: concat_t5_base
    datamodule: wikipedia1m


    Resulting config:

    task: concat_t5_base
    datamodule: wikipedia1m


    Expected config:

    task:
    _target_: xxx
    model_name: t5-base
    shuffle_labels: true
    datamodule:
    _target_: xxx
    num_workers: 4
    batch_size: 8


    Any idea on how to achieve the expected behaviour?

    Continue reading...

Compartilhe esta Página