code: def main():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--input_dir",
          help="Location of Mistral weights, which contains tokenizer.model and model folders",
      )
      parser.add_argument(
          "--model_size",
          choices=["7B", "tokenizer_only"],
          help="'f' models correspond to the finetuned versions, and are specific to the Mistral2 official release. For more details on Mistral2, checkout the original repo: https://huggingface.co/meta-mistral",
      )
      parser.add_argument(
          "--output_dir",
          help="Location to write HF model and tokenizer",
      )
      parser.add_argument(
          "--safe_serialization",
          type=bool,
          help="Whether or not to save using `safetensors`.",
      )
      args = parser.parse_args()
      spm_path = os.path.join(args.input_dir, "tokenizer.model")
      if args.model_size != "tokenizer_only":
          write_model(
              model_path=args.output_dir,
              input_base_path=args.input_dir,
              model_size=args.model_size,
              safe_serialization=args.safe_serialization,
              tokenizer_path=spm_path,
          )
      else:
          write_tokenizer(args.output_dir, spm_path)
  
file_path: transformers/src/transformers/models/mistral/convert_mistral_weights_to_hf.py
imports: import argparse
  import gc
  import json
  import os
  import shutil
  import warnings
  import torch
  from transformers import LlamaTokenizer, MistralConfig, MistralForCausalLM
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types