maxent_grpo.training.cli.trl¶
Copyright 2025 Liv d’Aliberti
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Helpers for parsing TRL-powered CLI arguments.
Functions
|
Parse GRPO CLI arguments or load them from a YAML recipe. |
- maxent_grpo.training.cli.trl.parse_grpo_args(recipe_path=None)[source]¶
Parse GRPO CLI arguments or load them from a YAML recipe.
When
recipe_path(or$GRPO_RECIPE) is provided, the YAML is loaded via OmegaConf and converted into config dataclasses so orchestration code remains recipe-agnostic.- Parameters:
recipe_path (str | None) – Optional explicit path to a GRPO recipe YAML file. When omitted the function looks for
$GRPO_RECIPEor--config.- Returns:
Tuple of
(script_args, training_args, model_args).- Return type:
tuple[GRPOScriptArguments, GRPOConfig, ModelConfig]
- Raises:
ImportError – If TRL is not installed and no recipe path is provided.
ValueError – If a recipe is provided but fails validation.
SystemExit – If the underlying CLI parser aborts due to invalid args.