def get_generation_config(model_name_or_path: str, **kwargs) -> Optional["GenerationConfig"]:
    """Get HF model's generation config for the given model_name_or_path. If not found, return None."""
    try:
        return from_pretrained(GenerationConfig, model_name_or_path, "model", **kwargs)
    except OSError:
        return None
Get HF model's generation config for the given model_name_or_path. If not found, return None.
olive/common/hf/utils.py