code: def _convert_llama(model_path, outfile_dir, outtype):
      model_path = Path(model_path)
      outfile_dir = Path(outfile_dir)
      model_plus = load_some_model(model_path)
      if model_plus.vocab is not None:
          vocab = model_plus.vocab
      else:
          vocab_dir = model_plus.paths[0].parent
          vocab = load_vocab(vocab_dir, vocabtype="spm")
      params = Params.load(model_plus)
      model = model_plus.model
      model = do_necessary_conversions(model, params)
      output_type = pick_output_type(model, outtype)
      model = convert_to_output_type(model, output_type)
      outfile_path = default_outfile([outfile_dir], output_type)
      OutputFile.write_all(
          outfile_path, params, output_type, model, vocab
      )
  
file_path: BigDL/python/llm/src/bigdl/llm/ggml/convert.py
imports: from bigdl.llm.utils.common import invalidInputError
  from bigdl.llm.utils.convert_util import *
  from pathlib import Path
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_llama(model_path, outfile_dir, outtype) without return types