Skip to content

Add a config generation CLI #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions yourbench/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from yourbench.analysis import run_analysis
from yourbench.pipeline.handler import run_pipeline
from yourbench.utils.config_generator import generate_and_save_config


app = typer.Typer(
Expand Down Expand Up @@ -119,6 +120,27 @@ def gui() -> None:
raise NotImplementedError("GUI support is not yet implemented.")


@app.command(help="Generate a YourBench configuration file interactively.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can you make sure this is always up to date with the modifs in the core code?

def generate_config(
output_path: Path = typer.Argument(
...,
help="Path where the generated configuration file will be saved.",
dir_okay=False,
),
) -> None:
"""
Generate a YourBench configuration file through an interactive CLI.

This command walks you through the process of creating a configuration file
for YourBench, similar to the 'accelerate config' command.

Example:
yourbench generate-config ./my_config.yaml
"""
logger.info(f"Generating configuration file at {output_path}")
generate_and_save_config(str(output_path))


def main() -> None:
"""
Main entry point for the CLI.
Expand Down
Loading