Search code examples
fb-hydra

Multirun with glob on files or folders


Assuming a directory structure like this:

/input/files/path
  /input1
    /file1_1.json
    /file1_2.json
  /input2
    /file2_1.json
  /someting_unrelated
  ...

I want to run a script that is configured using Hydra several times, each time getting the full path to one of the input* folders.

How could this be achieved?


Solution

  • Hydra does not support json. Use yaml files.

    As for multirun on a glob, see glob in the Override grammar page.

    e.g:

    python foo.py 'config/group=glob(input*)'
    

    Note that quoting may be required depending on your shell behavior.

    One thing that is not clear from your question is if your config files are in the config search path. If they are not you must their directory to the searchpath. See searchpath for more info.