code: def main(args):
      context = init_distributed_context(args.distributed_port)
      logger.info(f"Distributed context {context}")
  
      n_gpus = torch.cuda.device_count()
      with torch.cuda.device(context.local_rank % n_gpus):
          transcribe(args, context.rank, context.world_size)
  
      if context.world_size > 1:
          distr.barrier()
  
      if context.is_leader:
          generated_streams = ["units"]
          if args.durations:
              generated_streams += ["durations"]
          if args.f0s:
              generated_streams += ["f0s"]
  
          for stream_name in generated_streams:
              merge_files(args.output, stream_name, context.world_size)
  
file_path: textlesslib/tools/distributed_transcribe/transcribe.py
imports: import torch.distributed
  import torch
  import pathlib
  from data_handler import ManifestDataset
  from distributed import init_distributed_context
  import logging
  from textless.data.speech_encoder import SpeechEncoder
label_desc: Use image node_id 4 for calling a global function with example usage: main(args) without return types