blt/bytelatent/print_config.py
Pedro Rodriguez aa78c96ea4 Make it possible to specify multiple config files
Summary:

Make it possible to specify multiple config files.
Parsing CLI is not a special case anymore, just uses the same config inheritance method.

Test Plan:

Test that this iterpolates in the right order via unit tests

Sample usage, loads the internal config, which references bytelatent/configs/entropy_model.yaml. The precendence order is:

- Default pydantic args
- Included configs, eg `config`
- CLI args

```
python -m bytelatent.print_config config=internal/configs/entropy_model.yaml eval=null

```
2025-02-14 21:06:50 +00:00

12 lines
263 B
Python

from bytelatent.args import TrainArgs
from bytelatent.config_parser import parse_args_to_pydantic_model
def main():
train_args = parse_args_to_pydantic_model(TrainArgs)
print(train_args.model_dump_json(indent=4))
if __name__ == "__main__":
main()