class_docstr: Placeholder docstring
class_docstr_tok: ["Placeholder","docstring"]
code: def _upload_tgi_artifacts(
      self,
      model_path: str,
      sagemaker_session: Session,
      jumpstart: bool,
      s3_model_data_url: str = None,
      image: str = None,
      env_vars: dict = None,
  ):
      if s3_model_data_url:
          bucket, key_prefix = parse_s3_url(url=s3_model_data_url)
      else:
          bucket, key_prefix = None, None
  
      code_key_prefix = fw_utils.model_code_key_prefix(
          key_prefix, None, image
      )
  
      bucket, code_key_prefix = determine_bucket_and_prefix(
          bucket=bucket,
          key_prefix=code_key_prefix,
          sagemaker_session=sagemaker_session,
      )
  
      code_dir = Path(model_path).joinpath("code")
  
      s3_location = s3_path_join(
          "s3://", bucket, code_key_prefix, "code"
      )
  
      logger.debug(
          "Uploading TGI Model Resources uncompressed to: %s",
          s3_location,
      )
  
      model_data_url = S3Uploader.upload(
          str(code_dir),
          s3_location,
          None,
          sagemaker_session,
      )
  
      model_data = {
          "S3DataSource": {
              "CompressionType": "None",
              "S3DataType": "S3Prefix",
              "S3Uri": model_data_url + "/",
          }
      }
      if jumpstart:
          return (model_data, {})
      return (model_data, _update_env_vars(env_vars))
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/model_server/tgi/server.py
imports: from __future__ import absolute_import
  import requests
  import logging
  from pathlib import Path
  from docker.types import DeviceRequest
  from sagemaker import Session, fw_utils
  from sagemaker.serve.utils.exceptions import LocalModelInvocationException
  from sagemaker.base_predictor import PredictorBase
  from sagemaker.s3_utils import determine_bucket_and_prefix, parse_s3_url, s3_path_join
  from sagemaker.s3 import S3Uploader
  from sagemaker.local.utils import get_docker_host
label_desc: Use image node_id 1 for calling the SageMakerTgiServing obj's underlying member method code with example usage: obj._upload_tgi_artifacts(model_path, sagemaker_session, jumpstart, s3_model_data_url, image, env_vars) and returns: model_data,  _update_env_vars, model_data,  dict