code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
async def test_parallel_streaming(client: openai.AsyncOpenAI, model_name: str):
"""Streaming for parallel sampling.
The tokens from multiple samples, are flattened into a single stream,
with an index to indicate which sample the token belongs to.
"""
prompt = "What is an LLM?"
n = 3
max_tok... | Streaming for parallel sampling.
The tokens from multiple samples, are flattened into a single stream,
with an index to indicate which sample the token belongs to.
| test_parallel_streaming | python | kserve/kserve | python/huggingfaceserver/tests/test_vllm_generative.py | https://github.com/kserve/kserve/blob/master/python/huggingfaceserver/tests/test_vllm_generative.py | Apache-2.0 |
def sanitize_for_serialization(self, obj):
"""Builds a JSON POST object.
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is list, sanitize each... | Builds a JSON POST object.
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is list, sanitize each element in the list.
If obj is dict, return t... | sanitize_for_serialization | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def deserialize(self, response, response_type):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
:param response_type: class literal for
deserialized object, or string of class name.
:return: deserialized object.
"""
... | Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
:param response_type: class literal for
deserialized object, or string of class name.
:return: deserialized object.
| deserialize | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def __deserialize(self, data, klass):
"""Deserializes dict, list, str into an object.
:param data: dict, list or str.
:param klass: class literal, or string of class name.
:return: object.
"""
if data is None:
return None
if type(klass) == str:
... | Deserializes dict, list, str into an object.
:param data: dict, list or str.
:param klass: class literal, or string of class name.
:return: object.
| __deserialize | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None,
... | Makes the HTTP request (synchronous) and returns deserialized data.
To make an async_req request, set the async_req parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
:param path_params: Path parameters in the url.
:param query_params: Quer... | call_api | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def files_parameters(self, files=None):
"""Builds form parameters.
:param files: File parameters.
:return: Form parameters with files.
"""
params = []
if files:
for k, v in six.iteritems(files):
if not v:
continue
... | Builds form parameters.
:param files: File parameters.
:return: Form parameters with files.
| files_parameters | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def update_params_for_auth(self, headers, querys, auth_settings):
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication sett... | Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
| update_params_for_auth | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def __deserialize_file(self, response):
"""Deserializes body to file
Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided.
:param response: RESTResponse.
:return: file path.
"""
fd, path = t... | Deserializes body to file
Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided.
:param response: RESTResponse.
:return: file path.
| __deserialize_file | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def __deserialize_date(self, string):
"""Deserializes string to date.
:param string: str.
:return: date.
"""
try:
return parse(string).date()
except ImportError:
return string
except ValueError:
raise rest.ApiException(
... | Deserializes string to date.
:param string: str.
:return: date.
| __deserialize_date | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def __deserialize_datetime(self, string):
"""Deserializes string to datetime.
The string should be in iso8601 datetime format.
:param string: str.
:return: datetime.
"""
try:
return parse(string)
except ImportError:
return string
... | Deserializes string to datetime.
The string should be in iso8601 datetime format.
:param string: str.
:return: datetime.
| __deserialize_datetime | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def __deserialize_model(self, data, klass):
"""Deserializes list or dict to model.
:param data: dict, list.
:param klass: class literal.
:return: model object.
"""
has_discriminator = False
if (hasattr(klass, 'get_real_child_model')
and klass.disc... | Deserializes list or dict to model.
:param data: dict, list.
:param klass: class literal.
:return: model object.
| __deserialize_model | python | kserve/kserve | python/kserve/kserve/api_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api_client.py | Apache-2.0 |
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if self.refresh_api_key_hook is not None:
self.refresh_api_key_hook(self)
key ... | Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
| get_api_key_with_prefix | python | kserve/kserve | python/kserve/kserve/configuration.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/configuration.py | Apache-2.0 |
def get_host_from_settings(self, index, variables=None):
"""Gets host URL based on the index and variables
:param index: array index of the host settings
:param variables: hash of variable and the corresponding value
:return: URL based on host settings
"""
variables = {} ... | Gets host URL based on the index and variables
:param index: array index of the host settings
:param variables: hash of variable and the corresponding value
:return: URL based on host settings
| get_host_from_settings | python | kserve/kserve | python/kserve/kserve/configuration.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/configuration.py | Apache-2.0 |
async def close(self):
"""
Close the client. Any future calls to server
will result in an Error.
"""
await self._channel.close() |
Close the client. Any future calls to server
will result in an Error.
| close | python | kserve/kserve | python/kserve/kserve/inference_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/inference_client.py | Apache-2.0 |
def _construct_url(
self, base_url: Union[str, httpx.URL], relative_url: str
) -> httpx.URL:
"""
Merge a relative url argument together with any 'base_url' to create the URL used for the outgoing request.
:param base_url: The base url as str or httpx.URL object to use when constructi... |
Merge a relative url argument together with any 'base_url' to create the URL used for the outgoing request.
:param base_url: The base url as str or httpx.URL object to use when constructing request url.
:param relative_url: The relative url to use for merging with base url as string.
:r... | _construct_url | python | kserve/kserve | python/kserve/kserve/inference_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/inference_client.py | Apache-2.0 |
async def explain(
self,
base_url: Union[httpx.URL, str],
model_name: str,
data: Dict,
headers: Optional[Mapping[str, str]] = None,
timeout: Union[float, None, tuple, httpx.Timeout] = httpx.USE_CLIENT_DEFAULT,
) -> Dict:
"""
Run asynchronous explanatio... |
Run asynchronous explanation using the supplied data.
:param base_url: Base url of the inference server. E.g. https://example.com:443, https://example.com:443/serving
:param model_name: Name of the model as string.
:param data: Input data as python dict.
:param headers: (optiona... | explain | python | kserve/kserve | python/kserve/kserve/inference_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/inference_client.py | Apache-2.0 |
async def is_server_ready(
self,
base_url: Union[httpx.URL, str],
headers: Optional[Mapping[str, str]] = None,
timeout: Union[float, None, tuple, httpx.Timeout] = httpx.USE_CLIENT_DEFAULT,
) -> bool:
"""
Get readiness of the inference server.
:param base_url: ... |
Get readiness of the inference server.
:param base_url: Base url of the inference server. E.g. https://example.com:443, https://example.com:443/serving
:param headers: (optional) HTTP headers to include when sending request.
:param timeout: (optional) The maximum end-to-end time, in sec... | is_server_ready | python | kserve/kserve | python/kserve/kserve/inference_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/inference_client.py | Apache-2.0 |
async def is_server_live(
self,
base_url: Union[str, httpx.URL],
headers: Optional[Mapping[str, str]] = None,
timeout: Union[float, None, tuple, httpx.Timeout] = httpx.USE_CLIENT_DEFAULT,
) -> bool:
"""
Get liveness of the inference server.
:param base_url: Ba... |
Get liveness of the inference server.
:param base_url: Base url of the inference server. E.g. https://example.com:443, https://example.com:443/serving
:param headers: (optional) HTTP headers to include when sending request.
:param timeout: (optional) The maximum end-to-end time, in seco... | is_server_live | python | kserve/kserve | python/kserve/kserve/inference_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/inference_client.py | Apache-2.0 |
async def is_model_ready(
self,
base_url: Union[httpx.URL, str],
model_name: str,
headers: Optional[Mapping[str, str]] = None,
timeout: Union[float, None, tuple, httpx.Timeout] = httpx.USE_CLIENT_DEFAULT,
) -> bool:
"""
Get readiness of the specified model.
... |
Get readiness of the specified model.
:param base_url: Base url of the inference server. E.g. https://example.com:443, https://example.com:443/serving
:param model_name: Name of the model as string.
:param headers: (optional) HTTP headers to include when sending request.
:param ... | is_model_ready | python | kserve/kserve | python/kserve/kserve/inference_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/inference_client.py | Apache-2.0 |
async def close(self):
"""
Close the client, transport and proxies.
"""
await self._client.aclose() |
Close the client, transport and proxies.
| close | python | kserve/kserve | python/kserve/kserve/inference_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/inference_client.py | Apache-2.0 |
def configure_logging(log_config: Optional[Union[Dict, str]] = None):
"""
Configures Kserve and Uvicorn loggers.
This function should be called before loading the model / starting the model
server for consistent logging format.
:param log_config: (Optional) File path or dict containing log config. ... |
Configures Kserve and Uvicorn loggers.
This function should be called before loading the model / starting the model
server for consistent logging format.
:param log_config: (Optional) File path or dict containing log config. If not provided default configuration
will be used. If... | configure_logging | python | kserve/kserve | python/kserve/kserve/logging.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/logging.py | Apache-2.0 |
def __init__(self, name: str):
"""
Adds the required attributes
Args:
name: The name of the model.
"""
self.name = name
self.ready = False
self.engine = False |
Adds the required attributes
Args:
name: The name of the model.
| __init__ | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
async def healthy(self) -> bool:
"""
Check the health of this model. By default returns `self.ready`.
Returns:
True if healthy, false otherwise
"""
return self.ready |
Check the health of this model. By default returns `self.ready`.
Returns:
True if healthy, false otherwise
| healthy | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
async def start_engine(self):
"""Certain models may require an engine to be started before they can be used"""
self.ready = True | Certain models may require an engine to be started before they can be used | start_engine | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
def __init__(
self,
predictor_host: str,
predictor_protocol: str = PredictorProtocol.REST_V1.value,
predictor_use_ssl: bool = False,
predictor_request_timeout_seconds: int = 600,
predictor_request_retries: int = 0,
predictor_health_check: bool = False,
):
... | The configuration for the http call to the predictor
Args:
predictor_host: The host name of the predictor
predictor_protocol: The inference protocol used for predictor http call
predictor_use_ssl: Enable using ssl for http connection to the predictor
predictor_re... | __init__ | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
def __init__(
self,
name: str,
predictor_config: Optional[PredictorConfig] = None,
return_response_headers: bool = False,
):
"""KServe Model Public Interface
Model is intended to be subclassed to implement the model handlers.
Args:
name: The name... | KServe Model Public Interface
Model is intended to be subclassed to implement the model handlers.
Args:
name: The name of the model.
predictor_config: The configurations for http call to the predictor.
| __init__ | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
async def __call__(
self,
body: Union[Dict, CloudEvent, InferRequest],
headers: Optional[Dict[str, str]] = None,
verb: InferenceVerb = InferenceVerb.PREDICT,
) -> InferReturnType:
"""Method to call predictor or explainer with the given input.
Args:
body: ... | Method to call predictor or explainer with the given input.
Args:
body: Request body.
verb: The inference verb for predict/generate/explain
headers: Request headers.
Returns:
Response output from preprocess -> predict/generate/explain -> postprocess
... | __call__ | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
async def postprocess(
self,
result: Union[Dict, InferResponse],
headers: Dict[str, str] = None,
response_headers: Dict[str, str] = None,
) -> Union[Dict, InferResponse]:
"""The `postprocess` handler can be overridden for inference result or response transformation.
T... | The `postprocess` handler can be overridden for inference result or response transformation.
The predictor sends back the inference result in `Dict` for v1 endpoints and `InferResponse` for v2 endpoints.
Args:
result: The inference result passed from `predict` handler or the HTTP response f... | postprocess | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
async def predict(
self,
payload: Union[Dict, InferRequest, ModelInferRequest],
headers: Dict[str, str] = None,
response_headers: Dict[str, str] = None,
) -> Union[Dict, InferResponse, AsyncIterator[Any]]:
"""The `predict` handler can be overridden for performing the inferenc... | The `predict` handler can be overridden for performing the inference.
By default, the predict handler makes call to predictor for the inference step.
Args:
payload: Model inputs passed from `preprocess` handler.
headers: Request headers.
Returns:
Inferen... | predict | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
async def explain(self, payload: Dict, headers: Dict[str, str] = None) -> Dict:
"""`explain` handler can be overridden to implement the model explanation.
The default implementation makes call to the explainer if ``explainer_host`` is specified.
Args:
payload: Explainer model inputs... | `explain` handler can be overridden to implement the model explanation.
The default implementation makes call to the explainer if ``explainer_host`` is specified.
Args:
payload: Explainer model inputs passed from preprocess handler.
headers: Request headers.
Returns:
... | explain | python | kserve/kserve | python/kserve/kserve/model.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model.py | Apache-2.0 |
def update(self, model: BaseKServeModel, name: Optional[str] = None):
"""
Update or add a model to the repository.
Args:
model (BaseKServeModel): The model to be added or updated in the repository.
name (Optional[str], optional): The name to use for the model.
... |
Update or add a model to the repository.
Args:
model (BaseKServeModel): The model to be added or updated in the repository.
name (Optional[str], optional): The name to use for the model.
If not provided, the model's own name attribute will be used. Defaults to No... | update | python | kserve/kserve | python/kserve/kserve/model_repository.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model_repository.py | Apache-2.0 |
def start(self, models: List[BaseKServeModel]) -> None:
"""Start the model server with a set of registered models.
Args:
models: a list of models to register to the model server.
"""
self._register_and_check_atleast_one_model_is_ready(models)
if self.workers > 1:
... | Start the model server with a set of registered models.
Args:
models: a list of models to register to the model server.
| start | python | kserve/kserve | python/kserve/kserve/model_server.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model_server.py | Apache-2.0 |
def stop(self, sig: int):
"""Stop the instances of REST and gRPC model servers.
Args:
sig: The signal to stop the server.
"""
async def shutdown():
await InferenceClientFactory().close()
logger.info("Stopping the model server")
if self._r... | Stop the instances of REST and gRPC model servers.
Args:
sig: The signal to stop the server.
| stop | python | kserve/kserve | python/kserve/kserve/model_server.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model_server.py | Apache-2.0 |
def register_exception_handler(
self,
handler: Callable[[asyncio.events.AbstractEventLoop, Dict[str, Any]], None],
):
"""Add a custom handler as the event loop exception handler.
If a handler is not provided, the default exception handler will be set.
handler should be a ca... | Add a custom handler as the event loop exception handler.
If a handler is not provided, the default exception handler will be set.
handler should be a callable object, it should have a signature matching '(loop, context)', where 'loop'
will be a reference to the active event loop, 'context' wi... | register_exception_handler | python | kserve/kserve | python/kserve/kserve/model_server.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model_server.py | Apache-2.0 |
def default_exception_handler(
self, loop: asyncio.events.AbstractEventLoop, context: Dict[str, Any]
):
"""Default exception handler for event loop.
This is called when an exception occurs and no exception handler is set.
This can be called by a custom exception handler that wants t... | Default exception handler for event loop.
This is called when an exception occurs and no exception handler is set.
This can be called by a custom exception handler that wants to defer to the default handler behavior.
| default_exception_handler | python | kserve/kserve | python/kserve/kserve/model_server.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model_server.py | Apache-2.0 |
def register_model(self, model: BaseKServeModel, name: Optional[str] = None):
"""Register a model to the model server.
Args:
model: The model object.
name: The name of the model. If not provided, the model's name will be used. This can be used to provide
addition... | Register a model to the model server.
Args:
model: The model object.
name: The name of the model. If not provided, the model's name will be used. This can be used to provide
additional names for the same model.
| register_model | python | kserve/kserve | python/kserve/kserve/model_server.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/model_server.py | Apache-2.0 |
def set_gcs_credentials(namespace, credentials_file, service_account):
"""
Set GCS Credentials (secret and service account) with credentials file.
Args:
namespace(str): The kubernetes namespace.
credentials_file(str): The path for the gcs credentials file.
service_account(str): The n... |
Set GCS Credentials (secret and service account) with credentials file.
Args:
namespace(str): The kubernetes namespace.
credentials_file(str): The path for the gcs credentials file.
service_account(str): The name of service account. If the service_account
i... | set_gcs_credentials | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def set_s3_credentials(
namespace,
credentials_file,
service_account,
s3_profile="default", # pylint: disable=too-many-locals,too-many-arguments
s3_endpoint=None,
s3_region=None,
s3_use_https=None,
s3_verify_ssl=None,
s3_cabundle=None,
): # pylint: disable=unused-argument
"""
... |
Set S3 Credentials (secret and service account).
Args:
namespace(str): The kubernetes namespace.
credentials_file(str): The path for the S3 credentials file.
s3_profile(str): The profile for S3, default value is 'default'.
service_account(str): The name of service account(Option... | set_s3_credentials | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def set_azure_credentials(namespace, credentials_file, service_account):
"""
Set Azure Credentials (secret and service account) with credentials file.
Args:
namespace(str): The kubernetes namespace.
credentials_file(str): The path for the Azure credentials file.
service_account(str):... |
Set Azure Credentials (secret and service account) with credentials file.
Args:
namespace(str): The kubernetes namespace.
credentials_file(str): The path for the Azure credentials file.
service_account(str): The name of service account. If the service_account
... | set_azure_credentials | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def create_secret(namespace, annotations=None, data=None, string_data=None):
"Create namespaced secret, and return the secret name."
try:
created_secret = client.CoreV1Api().create_namespaced_secret(
namespace,
client.V1Secret(
api_version="v1",
ki... | Create namespaced secret, and return the secret name. | create_secret | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def set_service_account(namespace, service_account, secret_name):
"""
Set service account, create if service_account does not exist, otherwise patch it.
"""
if check_sa_exists(namespace=namespace, service_account=service_account):
patch_service_account(
secret_name=secret_name, names... |
Set service account, create if service_account does not exist, otherwise patch it.
| set_service_account | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def check_sa_exists(namespace, service_account):
"""
Check if the specified service account existing.
"""
sa_list = client.CoreV1Api().list_namespaced_service_account(namespace=namespace)
sa_name_list = [sa.metadata.name for sa in sa_list.items]
if service_account in sa_name_list:
retu... |
Check if the specified service account existing.
| check_sa_exists | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def create_service_account(secret_name, namespace, sa_name):
"""
Create namespaced service account, and return the service account name
"""
try:
client.CoreV1Api().create_namespaced_service_account(
namespace,
client.V1ServiceAccount(
metadata=client.V1Obj... |
Create namespaced service account, and return the service account name
| create_service_account | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def patch_service_account(secret_name, namespace, sa_name):
"""
Patch namespaced service account to attach with created secret.
"""
try:
client.CoreV1Api().patch_namespaced_service_account(
sa_name,
namespace,
client.V1ServiceAccount(
secrets=[... |
Patch namespaced service account to attach with created secret.
| patch_service_account | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def get_creds_name_from_config_map(creds):
"""
Get the credentials name from inferenceservice config map.
"""
try:
isvc_config_map = client.CoreV1Api().read_namespaced_config_map(
constants.INFERENCESERVICE_CONFIG_MAP_NAME,
constants.INFERENCESERVICE_SYSTEM_NAMESPACE,
... |
Get the credentials name from inferenceservice config map.
| get_creds_name_from_config_map | python | kserve/kserve | python/kserve/kserve/api/creds_utils.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/creds_utils.py | Apache-2.0 |
def __init__(
self,
config_file=None,
config_dict=None,
context=None, # pylint: disable=too-many-arguments
client_configuration=None,
persist_config=True,
):
"""
KServe client constructor
:param config_file: kubeconfig file, defaults to ~/.kub... |
KServe client constructor
:param config_file: kubeconfig file, defaults to ~/.kube/config
:param config_dict: Takes the config file as a dict.
:param context: kubernetes context
:param client_configuration: kubernetes configuration object
:param persist_config:
| __init__ | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def set_credentials(
self,
storage_type,
namespace=None,
credentials_file=None,
service_account=constants.DEFAULT_SA_NAME,
**kwargs,
):
"""
Setup credentials for KServe.
:param storage_type: Valid value: GCS or S3 (required)
:param nam... |
Setup credentials for KServe.
:param storage_type: Valid value: GCS or S3 (required)
:param namespace: inference service deployment namespace
:param credentials_file: the path for the credentials file.
:param service_account: the name of service account.
:param kwargs: ... | set_credentials | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def create(
self, inferenceservice, namespace=None, watch=False, timeout_seconds=600
): # pylint:disable=inconsistent-return-statements
"""
Create the inference service
:param inferenceservice: inference service object
:param namespace: defaults to current or default namespa... |
Create the inference service
:param inferenceservice: inference service object
:param namespace: defaults to current or default namespace
:param watch: True to watch the created service until timeout elapsed or status is ready
:param timeout_seconds: timeout seconds for watch, d... | create | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def get(
self,
name=None,
namespace=None,
watch=False,
timeout_seconds=600,
version=constants.KSERVE_V1BETA1_VERSION,
): # pylint:disable=inconsistent-return-statements
"""
Get the inference service
:param name: existing inference service name... |
Get the inference service
:param name: existing inference service name
:param namespace: defaults to current or default namespace
:param watch: True to watch the service until timeout elapsed or status is ready
:param timeout_seconds: timeout seconds for watch, default to 600s
... | get | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def patch(
self, name, inferenceservice, namespace=None, watch=False, timeout_seconds=600
): # pylint:disable=too-many-arguments,inconsistent-return-statements
"""
Patch existing inference service
:param name: existing inference service name
:param inferenceservice: patched ... |
Patch existing inference service
:param name: existing inference service name
:param inferenceservice: patched inference service
:param namespace: defaults to current or default namespace
:param watch: True to watch the patched service until timeout elapsed or status is ready
... | patch | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def replace(
self, name, inferenceservice, namespace=None, watch=False, timeout_seconds=600
): # pylint:disable=too-many-arguments,inconsistent-return-statements
"""
Replace the existing inference service
:param name: existing inference service name
:param inferenceservice: ... |
Replace the existing inference service
:param name: existing inference service name
:param inferenceservice: replacing inference service
:param namespace: defaults to current or default namespace
:param watch: True to watch the replaced service until timeout elapsed or status is... | replace | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def delete(self, name, namespace=None, version=constants.KSERVE_V1BETA1_VERSION):
"""
Delete the inference service
:param name: inference service name
:param namespace: defaults to current or default namespace
:param version: api group version
:return:
"""
... |
Delete the inference service
:param name: inference service name
:param namespace: defaults to current or default namespace
:param version: api group version
:return:
| delete | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def is_isvc_ready(
self, name, namespace=None, version=constants.KSERVE_V1BETA1_VERSION
): # pylint:disable=inconsistent-return-statements
"""
Check if the inference service is ready.
:param version:
:param name: inference service name
:param namespace: defaults to c... |
Check if the inference service is ready.
:param version:
:param name: inference service name
:param namespace: defaults to current or default namespace
:return:
| is_isvc_ready | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def wait_isvc_ready(
self,
name,
namespace=None, # pylint:disable=too-many-arguments
watch=False,
timeout_seconds=600,
polling_interval=10,
version=constants.KSERVE_V1BETA1_VERSION,
):
"""
Waiting for inference service ready, print out the inf... |
Waiting for inference service ready, print out the inference service if timeout.
:param name: inference service name
:param namespace: defaults to current or default namespace
:param watch: True to watch the service until timeout elapsed or status is ready
:param timeout_seconds... | wait_isvc_ready | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def create_trained_model(self, trainedmodel, namespace):
"""
Create a trained model
:param trainedmodel: trainedmodel object
:param namespace: defaults to current or default namespace
:return:
"""
version = trainedmodel.api_version.split("/")[1]
try:
... |
Create a trained model
:param trainedmodel: trainedmodel object
:param namespace: defaults to current or default namespace
:return:
| create_trained_model | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def delete_trained_model(
self, name, namespace=None, version=constants.KSERVE_V1ALPHA1_VERSION
):
"""
Delete the trained model
:param name: trained model name
:param namespace: defaults to current or default namespace
:param version: api group version
:return... |
Delete the trained model
:param name: trained model name
:param namespace: defaults to current or default namespace
:param version: api group version
:return:
| delete_trained_model | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def wait_model_ready(
self,
service_name,
model_name,
isvc_namespace=None, # pylint:disable=too-many-arguments
isvc_version=constants.KSERVE_V1BETA1_VERSION,
cluster_ip=None,
protocol_version="v1",
timeout_seconds=600,
polling_interval=10,
):
... |
Waiting for model to be ready to service, print out trained model if timeout.
:param service_name: inference service name
:param model_name: trained model name
:param isvc_namespace: defaults to current or default namespace of inference service
:param isvc_version: api group ver... | wait_model_ready | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def create_inference_graph(
self, inferencegraph: V1alpha1InferenceGraph, namespace: str = None
) -> object:
"""
create a inference graph
:param inferencegraph: inference graph object
:param namespace: defaults to current or default namespace
:return: created inferen... |
create a inference graph
:param inferencegraph: inference graph object
:param namespace: defaults to current or default namespace
:return: created inference graph
| create_inference_graph | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def delete_inference_graph(
self,
name: str,
namespace: str = None,
version: str = constants.KSERVE_V1ALPHA1_VERSION,
):
"""
Delete the inference graph
:param name: inference graph name
:param namespace: defaults to current or default namespace
... |
Delete the inference graph
:param name: inference graph name
:param namespace: defaults to current or default namespace
:param version: api group version
| delete_inference_graph | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def get_inference_graph(
self,
name: str,
namespace: str = None,
version: str = constants.KSERVE_V1ALPHA1_VERSION,
) -> object:
"""
Get the inference graph
:param name: existing inference graph name
:param namespace: defaults to current or default nam... |
Get the inference graph
:param name: existing inference graph name
:param namespace: defaults to current or default namespace
:param version: api group version
:return: inference graph
| get_inference_graph | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def is_ig_ready(
self,
name: str,
namespace: str = None,
version: str = constants.KSERVE_V1ALPHA1_VERSION,
) -> bool:
"""
Check if the inference graph is ready.
:param name: inference graph name
:param namespace: defaults to current or default namespa... |
Check if the inference graph is ready.
:param name: inference graph name
:param namespace: defaults to current or default namespace
:param version: api group version
:return: true if inference graph is ready, else false.
| is_ig_ready | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def wait_ig_ready(
self,
name: str,
namespace: str = None,
version: str = constants.KSERVE_V1ALPHA1_VERSION,
timeout_seconds: int = 600,
polling_interval: int = 10,
):
"""
Wait for inference graph to be ready until timeout. Print out the inference grap... |
Wait for inference graph to be ready until timeout. Print out the inference graph if timeout.
:param name: inference graph name
:param namespace: defaults to current or default namespace
:param version: api group version
:param timeout_seconds: timeout seconds for waiting, defa... | wait_ig_ready | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def create_local_model_node_group(
self, localmodelnodegroup: V1alpha1LocalModelNodeGroup
):
"""
Create a local model node group
:param localmodelnodegroup: local model node group object
:return: created local model node group object
"""
version = localmodeln... |
Create a local model node group
:param localmodelnodegroup: local model node group object
:return: created local model node group object
| create_local_model_node_group | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def get_local_model_node_group(
self, name: str, version: str = constants.KSERVE_V1ALPHA1_VERSION
) -> object:
"""
Get the local model node group
:param name: existing local model node group name
:param version: api group version. Default to v1alpha
:return: local mo... |
Get the local model node group
:param name: existing local model node group name
:param version: api group version. Default to v1alpha
:return: local model node group object
| get_local_model_node_group | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def delete_local_model_node_group(
self, name: str, version: str = constants.KSERVE_V1ALPHA1_VERSION
):
"""
Delete the local model node group
:param name: local model node group name
:param version: api group version. Default to v1alpha
"""
try:
s... |
Delete the local model node group
:param name: local model node group name
:param version: api group version. Default to v1alpha
| delete_local_model_node_group | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def create_local_model_cache(
self, localmodelcache: V1alpha1LocalModelCache
) -> object:
"""
Create a local model cache
:param localmodelcache: local model cache object
:return: created local model cache object
"""
version = localmodelcache.api_version.split... |
Create a local model cache
:param localmodelcache: local model cache object
:return: created local model cache object
| create_local_model_cache | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def get_local_model_cache(
self, name: str, version: str = constants.KSERVE_V1ALPHA1_VERSION
) -> object:
"""
Get the local model cache
:param name: existing local model cache name
:param version: api group version. Default to v1alpha1
:return: local model cache obje... |
Get the local model cache
:param name: existing local model cache name
:param version: api group version. Default to v1alpha1
:return: local model cache object
| get_local_model_cache | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def delete_local_model_cache(
self, name: str, version: str = constants.KSERVE_V1ALPHA1_VERSION
):
"""
Delete the local model cache
:param name: local model cache name
:param version: api group version. Default to v1alpha1
"""
try:
self.api_instan... |
Delete the local model cache
:param name: local model cache name
:param version: api group version. Default to v1alpha1
| delete_local_model_cache | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def is_local_model_cache_ready(
self,
name: str,
nodes: List[str],
version: str = constants.KSERVE_V1ALPHA1_VERSION,
) -> bool:
"""
Verify if the model is successfully cached on the specified node.
:param name: local model cache name
:param node_name:... |
Verify if the model is successfully cached on the specified node.
:param name: local model cache name
:param node_name: name of the node to check if the model is cached
:param version: api group version
:return: true if the model is successfully cached, else false.
| is_local_model_cache_ready | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def wait_local_model_cache_ready(
self,
name: str,
nodes: List[str],
version: str = constants.KSERVE_V1ALPHA1_VERSION,
timeout_seconds: int = 600,
polling_interval: int = 10,
):
"""
Wait for model to be cached locally for specified nodes until timeout.... |
Wait for model to be cached locally for specified nodes until timeout.
:param name: local model cache name
:param nodes: list of node names to check if the model is cached
:param version: api group version
:param timeout_seconds: timeout seconds for waiting, default to 600s.
... | wait_local_model_cache_ready | python | kserve/kserve | python/kserve/kserve/api/kserve_client.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/kserve_client.py | Apache-2.0 |
def isvc_watch(name=None, namespace=None, timeout_seconds=600, generation=0):
"""Watch the created or patched InferenceService in the specified namespace"""
if namespace is None:
namespace = utils.get_default_target_namespace()
headers = ["NAME", "READY", "PREV", "LATEST", "URL"]
table_fmt = "... | Watch the created or patched InferenceService in the specified namespace | isvc_watch | python | kserve/kserve | python/kserve/kserve/api/watch.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/api/watch.py | Apache-2.0 |
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if has... | Returns the model properties as a dict | to_dict | python | kserve/kserve | python/kserve/kserve/models/knative_addressable.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_addressable.py | Apache-2.0 |
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, KnativeAddressable):
return True
return self.to_dict() != other.to_dict() | Returns true if both objects are not equal | __ne__ | python | kserve/kserve | python/kserve/kserve/models/knative_addressable.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_addressable.py | Apache-2.0 |
def status(self, status):
"""Sets the status of this KnativeCondition.
Status of the condition, one of True, False, Unknown. # noqa: E501
:param status: The status of this KnativeCondition. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_valid... | Sets the status of this KnativeCondition.
Status of the condition, one of True, False, Unknown. # noqa: E501
:param status: The status of this KnativeCondition. # noqa: E501
:type: str
| status | python | kserve/kserve | python/kserve/kserve/models/knative_condition.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_condition.py | Apache-2.0 |
def type(self, type):
"""Sets the type of this KnativeCondition.
Type of condition. # noqa: E501
:param type: The type of this KnativeCondition. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
... | Sets the type of this KnativeCondition.
Type of condition. # noqa: E501
:param type: The type of this KnativeCondition. # noqa: E501
:type: str
| type | python | kserve/kserve | python/kserve/kserve/models/knative_condition.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_condition.py | Apache-2.0 |
def force_query(self, force_query):
"""Sets the force_query of this KnativeURL.
encoded path hint (see EscapedPath method) # noqa: E501
:param force_query: The force_query of this KnativeURL. # noqa: E501
:type: bool
"""
if self.local_vars_configuration.client_side_va... | Sets the force_query of this KnativeURL.
encoded path hint (see EscapedPath method) # noqa: E501
:param force_query: The force_query of this KnativeURL. # noqa: E501
:type: bool
| force_query | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def fragment(self, fragment):
"""Sets the fragment of this KnativeURL.
encoded query values, without '?' # noqa: E501
:param fragment: The fragment of this KnativeURL. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and fragment is ... | Sets the fragment of this KnativeURL.
encoded query values, without '?' # noqa: E501
:param fragment: The fragment of this KnativeURL. # noqa: E501
:type: str
| fragment | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def host(self, host):
"""Sets the host of this KnativeURL.
username and password information # noqa: E501
:param host: The host of this KnativeURL. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and host is None: # noqa: E501
... | Sets the host of this KnativeURL.
username and password information # noqa: E501
:param host: The host of this KnativeURL. # noqa: E501
:type: str
| host | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def opaque(self, opaque):
"""Sets the opaque of this KnativeURL.
:param opaque: The opaque of this KnativeURL. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and opaque is None: # noqa: E501
raise ValueError("Invalid value for ... | Sets the opaque of this KnativeURL.
:param opaque: The opaque of this KnativeURL. # noqa: E501
:type: str
| opaque | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def path(self, path):
"""Sets the path of this KnativeURL.
host or host:port # noqa: E501
:param path: The path of this KnativeURL. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and path is None: # noqa: E501
raise Va... | Sets the path of this KnativeURL.
host or host:port # noqa: E501
:param path: The path of this KnativeURL. # noqa: E501
:type: str
| path | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def raw_query(self, raw_query):
"""Sets the raw_query of this KnativeURL.
append a query ('?') even if RawQuery is empty # noqa: E501
:param raw_query: The raw_query of this KnativeURL. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validatio... | Sets the raw_query of this KnativeURL.
append a query ('?') even if RawQuery is empty # noqa: E501
:param raw_query: The raw_query of this KnativeURL. # noqa: E501
:type: str
| raw_query | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def scheme(self, scheme):
"""Sets the scheme of this KnativeURL.
:param scheme: The scheme of this KnativeURL. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and scheme is None: # noqa: E501
raise ValueError("Invalid value for ... | Sets the scheme of this KnativeURL.
:param scheme: The scheme of this KnativeURL. # noqa: E501
:type: str
| scheme | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def user(self, user):
"""Sets the user of this KnativeURL.
:param user: The user of this KnativeURL. # noqa: E501
:type: NetUrlUserinfo
"""
if self.local_vars_configuration.client_side_validation and user is None: # noqa: E501
raise ValueError("Invalid value for `... | Sets the user of this KnativeURL.
:param user: The user of this KnativeURL. # noqa: E501
:type: NetUrlUserinfo
| user | python | kserve/kserve | python/kserve/kserve/models/knative_url.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_url.py | Apache-2.0 |
def time(self, time):
"""Sets the time of this KnativeVolatileTime.
:param time: The time of this KnativeVolatileTime. # noqa: E501
:type: datetime
"""
if self.local_vars_configuration.client_side_validation and time is None: # noqa: E501
raise ValueError("Invalid... | Sets the time of this KnativeVolatileTime.
:param time: The time of this KnativeVolatileTime. # noqa: E501
:type: datetime
| time | python | kserve/kserve | python/kserve/kserve/models/knative_volatile_time.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/knative_volatile_time.py | Apache-2.0 |
def password(self, password):
"""Sets the password of this NetUrlUserinfo.
:param password: The password of this NetUrlUserinfo. # noqa: E501
:type: str
"""
if password is None:
raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501
... | Sets the password of this NetUrlUserinfo.
:param password: The password of this NetUrlUserinfo. # noqa: E501
:type: str
| password | python | kserve/kserve | python/kserve/kserve/models/net_url_userinfo.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/net_url_userinfo.py | Apache-2.0 |
def password_set(self, password_set):
"""Sets the password_set of this NetUrlUserinfo.
:param password_set: The password_set of this NetUrlUserinfo. # noqa: E501
:type: bool
"""
if password_set is None:
raise ValueError("Invalid value for `password_set`, must not b... | Sets the password_set of this NetUrlUserinfo.
:param password_set: The password_set of this NetUrlUserinfo. # noqa: E501
:type: bool
| password_set | python | kserve/kserve | python/kserve/kserve/models/net_url_userinfo.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/net_url_userinfo.py | Apache-2.0 |
def username(self, username):
"""Sets the username of this NetUrlUserinfo.
:param username: The username of this NetUrlUserinfo. # noqa: E501
:type: str
"""
if username is None:
raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501
... | Sets the username of this NetUrlUserinfo.
:param username: The username of this NetUrlUserinfo. # noqa: E501
:type: str
| username | python | kserve/kserve | python/kserve/kserve/models/net_url_userinfo.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/net_url_userinfo.py | Apache-2.0 |
def items(self, items):
"""Sets the items of this V1alpha1ClusterServingRuntimeList.
:param items: The items of this V1alpha1ClusterServingRuntimeList. # noqa: E501
:type: list[V1alpha1ClusterServingRuntime]
"""
if self.local_vars_configuration.client_side_validation and items... | Sets the items of this V1alpha1ClusterServingRuntimeList.
:param items: The items of this V1alpha1ClusterServingRuntimeList. # noqa: E501
:type: list[V1alpha1ClusterServingRuntime]
| items | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_cluster_serving_runtime_list.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_cluster_serving_runtime_list.py | Apache-2.0 |
def items(self, items):
"""Sets the items of this V1alpha1ClusterStorageContainerList.
:param items: The items of this V1alpha1ClusterStorageContainerList. # noqa: E501
:type: list[V1alpha1ClusterStorageContainer]
"""
if self.local_vars_configuration.client_side_validation and... | Sets the items of this V1alpha1ClusterStorageContainerList.
:param items: The items of this V1alpha1ClusterStorageContainerList. # noqa: E501
:type: list[V1alpha1ClusterStorageContainer]
| items | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_cluster_storage_container_list.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_cluster_storage_container_list.py | Apache-2.0 |
def items(self, items):
"""Sets the items of this V1alpha1InferenceGraphList.
:param items: The items of this V1alpha1InferenceGraphList. # noqa: E501
:type: list[V1alpha1InferenceGraph]
"""
if self.local_vars_configuration.client_side_validation and items is None: # noqa: E5... | Sets the items of this V1alpha1InferenceGraphList.
:param items: The items of this V1alpha1InferenceGraphList. # noqa: E501
:type: list[V1alpha1InferenceGraph]
| items | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_inference_graph_list.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_inference_graph_list.py | Apache-2.0 |
def nodes(self, nodes):
"""Sets the nodes of this V1alpha1InferenceGraphSpec.
Map of InferenceGraph router nodes Each node defines the router which can be different routing types # noqa: E501
:param nodes: The nodes of this V1alpha1InferenceGraphSpec. # noqa: E501
:type: dict(str, V1... | Sets the nodes of this V1alpha1InferenceGraphSpec.
Map of InferenceGraph router nodes Each node defines the router which can be different routing types # noqa: E501
:param nodes: The nodes of this V1alpha1InferenceGraphSpec. # noqa: E501
:type: dict(str, V1alpha1InferenceRouter)
| nodes | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_inference_graph_spec.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_inference_graph_spec.py | Apache-2.0 |
def router_type(self, router_type):
"""Sets the router_type of this V1alpha1InferenceRouter.
RouterType - `Sequence:` chain multiple inference steps with input/output from previous step - `Splitter:` randomly routes to the target service according to the weight - `Ensemble:` routes the request to mu... | Sets the router_type of this V1alpha1InferenceRouter.
RouterType - `Sequence:` chain multiple inference steps with input/output from previous step - `Splitter:` randomly routes to the target service according to the weight - `Ensemble:` routes the request to multiple models and then merge the responses - `... | router_type | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_inference_router.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_inference_router.py | Apache-2.0 |
def items(self, items):
"""Sets the items of this V1alpha1LocalModelCacheList.
:param items: The items of this V1alpha1LocalModelCacheList. # noqa: E501
:type: list[V1alpha1LocalModelCache]
"""
if self.local_vars_configuration.client_side_validation and items is None: # noqa:... | Sets the items of this V1alpha1LocalModelCacheList.
:param items: The items of this V1alpha1LocalModelCacheList. # noqa: E501
:type: list[V1alpha1LocalModelCache]
| items | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_cache_list.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_cache_list.py | Apache-2.0 |
def model_size(self, model_size):
"""Sets the model_size of this V1alpha1LocalModelCacheSpec.
:param model_size: The model_size of this V1alpha1LocalModelCacheSpec. # noqa: E501
:type: ResourceQuantity
"""
if self.local_vars_configuration.client_side_validation and model_size ... | Sets the model_size of this V1alpha1LocalModelCacheSpec.
:param model_size: The model_size of this V1alpha1LocalModelCacheSpec. # noqa: E501
:type: ResourceQuantity
| model_size | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_cache_spec.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_cache_spec.py | Apache-2.0 |
def node_groups(self, node_groups):
"""Sets the node_groups of this V1alpha1LocalModelCacheSpec.
group of nodes to cache the model on. Todo: support more than 1 node groups # noqa: E501
:param node_groups: The node_groups of this V1alpha1LocalModelCacheSpec. # noqa: E501
:type: list[... | Sets the node_groups of this V1alpha1LocalModelCacheSpec.
group of nodes to cache the model on. Todo: support more than 1 node groups # noqa: E501
:param node_groups: The node_groups of this V1alpha1LocalModelCacheSpec. # noqa: E501
:type: list[str]
| node_groups | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_cache_spec.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_cache_spec.py | Apache-2.0 |
def source_model_uri(self, source_model_uri):
"""Sets the source_model_uri of this V1alpha1LocalModelCacheSpec.
Original StorageUri # noqa: E501
:param source_model_uri: The source_model_uri of this V1alpha1LocalModelCacheSpec. # noqa: E501
:type: str
"""
if self.loca... | Sets the source_model_uri of this V1alpha1LocalModelCacheSpec.
Original StorageUri # noqa: E501
:param source_model_uri: The source_model_uri of this V1alpha1LocalModelCacheSpec. # noqa: E501
:type: str
| source_model_uri | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_cache_spec.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_cache_spec.py | Apache-2.0 |
def items(self, items):
"""Sets the items of this V1alpha1LocalModelNodeGroupList.
:param items: The items of this V1alpha1LocalModelNodeGroupList. # noqa: E501
:type: list[V1alpha1LocalModelNodeGroup]
"""
if self.local_vars_configuration.client_side_validation and items is No... | Sets the items of this V1alpha1LocalModelNodeGroupList.
:param items: The items of this V1alpha1LocalModelNodeGroupList. # noqa: E501
:type: list[V1alpha1LocalModelNodeGroup]
| items | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_node_group_list.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_node_group_list.py | Apache-2.0 |
def persistent_volume_claim_spec(self, persistent_volume_claim_spec):
"""Sets the persistent_volume_claim_spec of this V1alpha1LocalModelNodeGroupSpec.
:param persistent_volume_claim_spec: The persistent_volume_claim_spec of this V1alpha1LocalModelNodeGroupSpec. # noqa: E501
:type: V1Persiste... | Sets the persistent_volume_claim_spec of this V1alpha1LocalModelNodeGroupSpec.
:param persistent_volume_claim_spec: The persistent_volume_claim_spec of this V1alpha1LocalModelNodeGroupSpec. # noqa: E501
:type: V1PersistentVolumeClaimSpec
| persistent_volume_claim_spec | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_node_group_spec.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_node_group_spec.py | Apache-2.0 |
def persistent_volume_spec(self, persistent_volume_spec):
"""Sets the persistent_volume_spec of this V1alpha1LocalModelNodeGroupSpec.
:param persistent_volume_spec: The persistent_volume_spec of this V1alpha1LocalModelNodeGroupSpec. # noqa: E501
:type: V1PersistentVolumeSpec
"""
... | Sets the persistent_volume_spec of this V1alpha1LocalModelNodeGroupSpec.
:param persistent_volume_spec: The persistent_volume_spec of this V1alpha1LocalModelNodeGroupSpec. # noqa: E501
:type: V1PersistentVolumeSpec
| persistent_volume_spec | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_node_group_spec.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_node_group_spec.py | Apache-2.0 |
def items(self, items):
"""Sets the items of this V1alpha1LocalModelNodeList.
:param items: The items of this V1alpha1LocalModelNodeList. # noqa: E501
:type: list[V1alpha1LocalModelNode]
"""
if self.local_vars_configuration.client_side_validation and items is None: # noqa: E5... | Sets the items of this V1alpha1LocalModelNodeList.
:param items: The items of this V1alpha1LocalModelNodeList. # noqa: E501
:type: list[V1alpha1LocalModelNode]
| items | python | kserve/kserve | python/kserve/kserve/models/v1alpha1_local_model_node_list.py | https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_node_list.py | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.