code: def chatglm_load(
      path: str,
      n_ctx: int,
      n_threads: int,
      use_mmap: bool = False,
  ) -> ChatGLMContext:
      path = str(Path(path))
      pipeline = Pipeline(path, use_mmap)
      config = GenerationConfig(
          max_length=n_ctx,
          num_threads=n_threads,
      )
      return ChatGLMContext(pipeline, config)
  
file_path: BigDL/python/llm/src/bigdl/llm/ggml/model/chatglm/chatglm_cpp.py
imports: from typing import List
  from pathlib import Path
  from bigdl.llm.libs.chatglm_C import Pipeline, GenerationConfig
label_desc: Use image node_id 1 for calling a global function with example usage: chatglm_load(path, n_ctx, n_threads, use_mmap) and returns: ChatGLMContext