code: def main(
      batch_size=1,
      host="localhost",
      input_file_name="input.jsonl",
      output_file_name="output.jsonl",
      port_num=1424,
      process_lang=True,
  ):
      input_data = load_data(f"{input_file_name}")
      output_path = f"{output_file_name}"
      existing_requests = set()
      if os.path.exists(output_path):
          with open(output_path, "r", encoding="utf-8") as fin:
              for line in fin:
                  line = json.loads(line)
                  existing_requests.add(calculate_key(line))
          print(f"Loaded {len(existing_requests)} existing requests")
  
      filter_data = [
          d
          for d in input_data
          if calculate_key(d) not in existing_requests
      ]
  
      progress_bar = tqdm.tqdm(total=len(filter_data))
  
      worker = Worker(
          host=host,
          port=port_num,
          progress_bar=progress_bar,
          output_file=output_path,
          process_lang=process_lang,
      )
      for batch_idx in range(0, len(filter_data), batch_size):
          batch = [
              line
              for line in filter_data[
                  batch_idx : batch_idx + batch_size
              ]
          ]
          turns = [
              0
              if "mask" not in d["conversations"][0]["from"]
              or d["conversations"][0]["from"] == d["mask"]
              else 1
              for d in batch
          ]
          task = [
              {
                  "prompt": get_prompt(d, turn, "", 0),
                  "item": d,
                  "turn": turn,
              }
              for d, turn in zip(batch, turns)
          ]
          worker.process_result(task)
      worker.fout.close()
  
file_path: NeMo/scripts/nlp_language_modeling/sft/attribute_annotate.py
imports: import json
  import os
  import fire
  import tqdm
  from langchain.prompts.few_shot import PromptTemplate
  from nemo.collections.nlp.modules.common.megatron.retrieval_services.util import text_generation
label_desc: Use image node_id 5 for calling a global function with example usage: main(batch_size, host, input_file_name, output_file_name, port_num, process_lang) without return types