class_docstr: Provides access to the Triton Config and the scripted module.
class_docstr_tok: ["Provides","access","to","the","Triton","Config","and","the","scripted","module","."]
docstr: Save the Triton config.
  
  Return the appropriate artifact.
docstr_tok: ["Save","the","Triton","config",".","Return","the","appropriate","artifact","."]
code: def save_config(self) -> TritonArtifact:
      """Save the Triton config.
  
      Return the appropriate artifact.
      """
      device = self.device
      if self.inference_stage != PREDICTOR:
          device = "cpu"
      self.config = TritonConfig(
          self.full_model_name,
          self.input_features,
          self.output_features,
          self.max_batch_size,
          self.max_queue_delay_microseconds,
          device,
          self.model_instance_count,
          self.inference_stage,
      )
  
      config_path = os.path.join(self.base_path, "config.pbtxt")
      with open(config_path, "w") as f:
          formatted_config = remove_empty_lines(
              self.config.get_model_config()
          )
          f.write(formatted_config)
  
      config_artifact = TritonArtifact(
          model_name=self.full_model_name,
          model_version=self.model_version,
          platform="pytorch_libtorch",
          path=config_path,
          content_type="text/x-protobuf",
          content_length=os.path.getsize(config_path),
      )
  
      return config_artifact
  
imports: import importlib.util
  import os
  import re
  import shutil
  import tempfile
  from dataclasses import dataclass
  from typing import Dict, List, Optional, Tuple, Union
  import pandas
  import torch
  from ludwig.api import LudwigModel
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import AUDIO, BAG, BINARY, CATEGORY, DATE, IMAGE, INPUT_FEATURES, POSTPROCESSOR, PREDICTOR, PREPROCESSOR, SEQUENCE, SET, TEXT, TIMESERIES, TYPE, VECTOR
  from ludwig.data.dataset_synthesizer import build_synthetic_dataset
  from ludwig.models.inference import _InferencePostprocessor, _InferencePredictor, _InferencePreprocessor, InferenceModule
  from ludwig.types import ModelConfigDict
  from ludwig.utils.inference_utils import to_inference_module_input_from_dataframe
  from ludwig.utils.misc_utils import remove_empty_lines
  from ludwig.utils.torch_utils import model_size, place_on_device
  from ludwig.utils.types import TorchAudioTuple, TorchscriptPreprocessingInput
label_desc: Use image node_id 3 for calling the TritonMaster obj's underlying member method code with example usage: obj.save_config() and returns: config_artifact