class_docstr: Initialize a new Inference Client.
  
  [`InferenceClient`] aims to provide a unified experience to perform inference. The client can be used
  seamlessly with either the (free) Inference API or self-hosted Inference Endpoints.
  
  Args:
      model (`str`, `optional`):
          The model to run inference with. Can be a model id hosted on the Hugging Face Hub, e.g. `bigcode/starcoder`
          or a URL to a deployed Inference Endpoint. Defaults to None, in which case a recommended model is
          automatically selected for the task.
      token (`str`, *optional*):
          Hugging Face token. Will default to the locally saved token. Pass `token=False` if you don't want to send
          your token to the server.
      timeout (`float`, `optional`):
          The maximum number of seconds to wait for a response from the server. Loading a new model in Inference
          API can take up to several minutes. Defaults to None, meaning it will loop until the server is available.
      headers (`Dict[str, str]`, `optional`):
          Additional headers to send to the server. By default only the authorization and user-agent headers are sent.
          Values in this dictionary will override the default values.
      cookies (`Dict[str, str]`, `optional`):
          Additional cookies to send to the server.
docstr: Get the status of a model hosted on the Inference API.
  
  <Tip>
  
  This endpoint is mostly useful when you already know which model you want to use and want to check its
  availability. If you want to discover already deployed models, you should rather use [`~InferenceClient.list_deployed_models`].
  
  </Tip>
  
  Args:
      model (`str`, *optional*):
          Identifier of the model for witch the status gonna be checked. If model is not provided,
          the model associated with this instance of [`InferenceClient`] will be used. Only InferenceAPI service can be checked so the
          identifier cannot be a URL.
  
  
  Returns:
      [`ModelStatus`]: An instance of ModelStatus dataclass, containing information,
                   about the state of the model: load, state, compute type and framework.
  
  Example:
  ```py
  >>> from huggingface_hub import InferenceClient
  >>> client = InferenceClient()
  >>> client.get_model_status("bigcode/starcoder")
  ModelStatus(loaded=True, state='Loaded', compute_type='gpu', framework='text-generation-inference')
  ```
docstr_tok: ["Get","the","status","of","a","model","hosted","on","the","Inference","API",".","<","Tip",">","This","endpoint","is","mostly","useful","when","you","already","know","which","model","you","want","to","use","and","want","to","check","its","availability",".","If","you","want","to","discover","already","deployed","models",",","you","should","rather","use","[","`","~InferenceClient.list_deployed_models","`","]",".","<","\/Tip",">","Args",":","model","(","`","str","`",",","*","optional","*",")",":","Identifier","of","the","model","for","witch","the","status","gon","na","be","checked",".","If","model","is","not","provided",",","the","model","associated","with","this","instance","of","[","`","InferenceClient","`","]","will","be","used",".","Only","InferenceAPI","service","can","be","checked","so","the","identifier","can","not","be","a","URL",".","Returns",":","[","`","ModelStatus","`","]",":","An","instance","of","ModelStatus","dataclass",",","containing","information",",","about","the","state","of","the","model",":","load",",","state",",","compute","type","and","framework",".","Example",":","``","`","py",">",">",">","from","huggingface_hub","import","InferenceClient",">",">",">","client","=","InferenceClient","(",")",">",">",">","client.get_model_status","(","``","bigcode\/starcoder","''",")","ModelStatus","(","loaded=True",",","state='Loaded","'",",","compute_type='gpu","'",",","framework='text-generation-inference","'",")","``","`"]
code: def get_model_status(
      self, model: Optional[str] = None
  ) -> ModelStatus:
      """
      Get the status of a model hosted on the Inference API.
  
      <Tip>
  
      This endpoint is mostly useful when you already know which model you want to use and want to check its
      availability. If you want to discover already deployed models, you should rather use [`~InferenceClient.list_deployed_models`].
  
      </Tip>
  
      Args:
          model (`str`, *optional*):
              Identifier of the model for witch the status gonna be checked. If model is not provided,
              the model associated with this instance of [`InferenceClient`] will be used. Only InferenceAPI service can be checked so the
              identifier cannot be a URL.
  
  
      Returns:
          [`ModelStatus`]: An instance of ModelStatus dataclass, containing information,
                       about the state of the model: load, state, compute type and framework.
  
      Example:
      ```py
      >>> from huggingface_hub import InferenceClient
      >>> client = InferenceClient()
      >>> client.get_model_status("bigcode/starcoder")
      ModelStatus(loaded=True, state='Loaded', compute_type='gpu', framework='text-generation-inference')
      ```
      """
      model = model or self.model
      if model is None:
          raise ValueError("Model id not provided.")
      if model.startswith("https://"):
          raise NotImplementedError(
              "Model status is only available for Inference API endpoints."
          )
      url = f"{INFERENCE_ENDPOINT}/status/{model}"
  
      response = get_session().get(url, headers=self.headers)
      hf_raise_for_status(response)
      response_data = response.json()
  
      if "error" in response_data:
          raise ValueError(response_data["error"])
  
      return ModelStatus(
          loaded=response_data["loaded"],
          state=response_data["state"],
          compute_type=response_data["compute_type"],
          framework=response_data["framework"],
      )
  
imports: import logging
  import time
  import warnings
  from dataclasses import asdict
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Literal, Optional, Union, overload
  from requests import HTTPError
  from requests.structures import CaseInsensitiveDict
  from huggingface_hub.constants import ALL_INFERENCE_API_FRAMEWORKS, INFERENCE_ENDPOINT, MAIN_INFERENCE_API_FRAMEWORKS
  from huggingface_hub.inference._common import TASKS_EXPECTING_IMAGES, ContentT, InferenceTimeoutError, ModelStatus, _b64_encode, _b64_to_image, _bytes_to_dict, _bytes_to_image, _bytes_to_list, _fetch_recommended_models, _import_numpy, _is_tgi_server, _open_as_binary, _set_as_non_tgi, _stream_text_generation_response
  from huggingface_hub.inference._text_generation import TextGenerationParameters, TextGenerationRequest, TextGenerationResponse, TextGenerationStreamResponse, raise_text_generation_error
  from huggingface_hub.inference._types import ClassificationOutput, ConversationalOutput, FillMaskOutput, ImageSegmentationOutput, ObjectDetectionOutput, QuestionAnsweringOutput, TableQuestionAnsweringOutput, TokenClassificationOutput
  from huggingface_hub.utils import BadRequestError, build_hf_headers, get_session, hf_raise_for_status
label_desc: Use image node_id 39 for calling the InferenceClient obj's underlying member method code with example usage: obj.get_model_status(model) and returns: ModelStatus