def patch_config(
    config_json_path: str,
    sampler: str = None,
    execution_order: str = None,
    system: str = None,
    is_gpu: bool = False,
    hf_token: bool = False,
):
    """Load the config json file and patch it with the given search algorithm, execution order and system."""
    with open(config_json_path) as fin:
        olive_config = json.load(fin)
    # set default logger severity
    olive_config["log_severity_level"] = 0
    # set clean cache
    olive_config["clean_cache"] = True

    # update search strategy
    if not sampler:
        olive_config["search_strategy"] = False
    else:
        olive_config["search_strategy"] = {
            "sampler": sampler,
            "execution_order": execution_order,
        }
        if sampler in ("random", "tpe"):
            olive_config["search_strategy"].update({"max_samples": 3, "seed": 0})

    update_azureml_config(olive_config)
    if system == "aml_system":
        # set aml_system
        set_aml_system(olive_config, is_gpu=is_gpu, hf_token=hf_token)
        olive_config["host"] = system
        olive_config["target"] = system
    elif system == "docker_system":
        # set docker_system
        set_docker_system(olive_config)
        olive_config["host"] = system
        olive_config["target"] = system
        # reduce agent size for docker system

        # as our docker image is big, we need to reduce the agent size to avoid timeout
        # for the docker system test, we skip to search for transformers optimization as
        # it is tested in other olive system tests
        olive_config["search_strategy"]["max_samples"] = 2

    return olive_config
Load the config json file and patch it with the given search algorithm, execution order and system.
examples/test/utils.py