code: def create_model_package_from_algorithm(self, name, description, algorithm_arn, model_data):
          
          request = {
              'ModelPackageName': name,
              'ModelPackageDescription': description,
              'SourceAlgorithmSpecification': {
                  'SourceAlgorithms': [
                      {
                          'AlgorithmName': algorithm_arn,
                          'ModelDataUrl': model_data
                      }
                  ]
              }
          }
          try:
              LOGGER.info('Creating model package with name: {}'.format(name))
              self.sagemaker_client.create_model_package(**request)
          except ClientError as e:
              error_code = e.response['Error']['Code']
              message = e.response['Error']['Message']
  
              if (
                      error_code == 'ValidationException'
                      and 'ModelPackage already exists' in message
              ):
                  LOGGER.warning('Using already existing model package: {}'.format(name))
              else:
                  raise
docs: Create a SageMaker Model Package from the results of training with an Algorithm Package
  
          Args:
              name (str): ModelPackage name
              description (str): Model Package description
              algorithm_arn (str): arn or name of the algorithm used for training.
              model_data (str): s3 URI to the model artifacts produced by training