diff --git a/src/lighteval/main_endpoint.py b/src/lighteval/main_endpoint.py index d17da432..4b31f0f2 100644 --- a/src/lighteval/main_endpoint.py +++ b/src/lighteval/main_endpoint.py @@ -231,7 +231,7 @@ def inference_endpoint( "endpoint_name": config["base_params"].get("endpoint_name", None), "model_dtype": config["base_params"].get("dtype", None), "revision": config["base_params"].get("revision", None) or "main", - "should_reuse_existing": config["base_params"].get("should_reuse_existing"), + "reuse_existing": config["base_params"].get("reuse_existing"), "accelerator": config.get("instance", {}).get("accelerator", None), "region": config.get("instance", {}).get("region", None), "vendor": config.get("instance", {}).get("vendor", None), diff --git a/src/lighteval/models/endpoints/endpoint_model.py b/src/lighteval/models/endpoints/endpoint_model.py index 3b08940f..909d4795 100644 --- a/src/lighteval/models/endpoints/endpoint_model.py +++ b/src/lighteval/models/endpoints/endpoint_model.py @@ -84,7 +84,7 @@ class InferenceModelConfig: class InferenceEndpointModelConfig: endpoint_name: str = None model_name: str = None - should_reuse_existing: bool = False + reuse_existing: bool = False accelerator: str = "gpu" model_dtype: str = None # if empty, we use the default vendor: str = "aws" @@ -135,7 +135,7 @@ class InferenceEndpointModel(LightevalModel): def __init__( # noqa: C901 self, config: Union[InferenceEndpointModelConfig, InferenceModelConfig], env_config: EnvConfig ) -> None: - self.reuse_existing = getattr(config, "should_reuse_existing", True) + self.reuse_existing = getattr(config, "reuse_existing", False) self._max_length = None self.endpoint = None self.model_name = None @@ -171,7 +171,7 @@ def __init__( # noqa: C901 ): try: if self.endpoint is None: # Endpoint does not exist yet locally - if not config.should_reuse_existing: # New endpoint + if not config.reuse_existing: # New endpoint logger.info("Creating endpoint.") self.endpoint: InferenceEndpoint = create_inference_endpoint( name=endpoint_name, @@ -239,7 +239,7 @@ def __init__( # noqa: C901 # The endpoint actually already exists, we'll spin it up instead of trying to create a new one if "409 Client Error: Conflict for url:" in str(e): config.endpoint_name = endpoint_name - config.should_reuse_existing = True + config.reuse_existing = True # Requested resources are not available elif "Bad Request: Compute instance not available yet" in str(e): logger.error(