code: def run_inference(args):
      llama_model_path = args.model_path
      llama_tokenize_path = args.tokenizer_path or args.model_path
  
      max_input_len = args.max_input_len
      max_output_len = args.max_output_len
      max_batch_size = args.batch_size
      micro_batch_size = args.micro_batch_size
      tp_size = args.tp_size
      pp_size = args.pp_size
      rank = dist.get_rank()
  
      tokenizer = LlamaTokenizer.from_pretrained(
          llama_tokenize_path, padding_side="left"
      )
      tokenizer.pad_token_id = tokenizer.eos_token_id
  
      if args.quant is None:
          model = LlamaForCausalLM.from_pretrained(
              llama_model_path, pad_token_id=tokenizer.pad_token_id
          )
      elif args.quant == "gptq":
          from auto_gptq import AutoGPTQForCausalLM
  
          model = AutoGPTQForCausalLM.from_quantized(
              llama_model_path,
              inject_fused_attention=False,
              device=torch.cuda.current_device(),
          )
      elif args.quant == "smoothquant":
          from colossalai.inference.quant.smoothquant.models.llama import (
              SmoothLlamaForCausalLM,
          )
  
          model = SmoothLlamaForCausalLM.from_quantized(
              llama_model_path,
              model_basename=args.smoothquant_base_name,
          )
          model = model.cuda()
  
      engine = InferenceEngine(
          tp_size=tp_size,
          pp_size=pp_size,
          model=model,
          max_input_len=max_input_len,
          max_output_len=max_output_len,
          max_batch_size=max_batch_size,
          micro_batch_size=micro_batch_size,
          quant=args.quant,
          dtype=args.dtype,
      )
  
      inputs = tokenizer(
          INPUT_TEXTS,
          return_tensors="pt",
          padding="longest",
          max_length=max_input_len,
          truncation=True,
      )
      inputs = {
          k: v.to(get_current_device()) for k, v in inputs.items()
      }
      outputs = engine.generate(inputs)
  
      if rank == 0:
          output_texts = tokenizer.batch_decode(
              outputs, skip_special_tokens=True
          )
          for input_text, output_text in zip(INPUT_TEXTS, output_texts):
              print(f"Input: {input_text}")
              print(f"Output: {output_text}")
  
file_path: colossalai/examples/inference/run_llama_inference.py
imports: import argparse
  import torch
  import torch.distributed
  from transformers import LlamaForCausalLM, LlamaTokenizer
  import colossalai
  from colossalai.inference import InferenceEngine
  from colossalai.testing import spawn
  from colossalai.utils.device import get_current_device
label_desc: Use image node_id 1 for calling a global function with example usage: run_inference(args) without return types