def run_command(params):
    """
    Executes a Python script with optional arguments in a specified project directory.

    Args:
        params (object): An object containing the following attributes:
            - project_name (str): The name of the project directory where the script is located.
            - args (dict): A dictionary of arguments to pass to the script. Keys are argument names, and values are argument values.

    Raises:
        ValueError: If the script.py file is not found in the specified project directory.

    Returns:
        None
    """
    if os.path.exists(f"{params.project_name}/script.py"):
        cmd = ["python", "script.py"]
        if params.args:
            for arg in params.args:
                cmd.append(f"--{arg}")
                if params.args[arg] != "":
                    cmd.append(params.args[arg])
        pipe = subprocess.Popen(cmd, cwd=params.project_name)
        pipe.wait()
        logger.info("Command finished.")
        return
    raise ValueError("No script.py found.")

    Executes a Python script with optional arguments in a specified project directory.

    Args:
        params (object): An object containing the following attributes:
            - project_name (str): The name of the project directory where the script is located.
            - args (dict): A dictionary of arguments to pass to the script. Keys are argument names, and values are argument values.

    Raises:
        ValueError: If the script.py file is not found in the specified project directory.

    Returns:
        None
    
src/autotrain/trainers/generic/utils.py