initContext method

  1. @override
Future<Map<Object?, dynamic>?> initContext(
  1. String model, {
  2. int modelType = 1,
  3. bool embedding = false,
  4. int nCtx = 768,
  5. int nBatch = 768,
  6. int nThreads = 2,
  7. int nGpuLayers = 0,
  8. bool useMlock = true,
  9. bool useMmap = true,
  10. String lora = "",
  11. bool loraInitWithoutApply = false,
  12. double loraScaled = 1.0,
  13. double ropeFreqBase = 0.0,
  14. double ropeFreqScale = 0.0,
  15. bool emitLoadProgress = false,
})
override

Implementation

@override
Future<Map<Object?, dynamic>?> initContext(String model,
    {int modelType = 1,
    bool embedding = false,
    int nCtx = 768,
    int nBatch = 768,
    int nThreads = 2,
    int nGpuLayers = 0,
    bool useMlock = true,
    bool useMmap = true,
    String lora = "",
    bool loraInitWithoutApply = false,
    double loraScaled = 1.0,
    double ropeFreqBase = 0.0,
    double ropeFreqScale = 0.0,
    bool emitLoadProgress = false}) async {
  return await methodChannel
      .invokeMethod<Map<Object?, dynamic>>("initContext", {
    "model": model,
    "modelType": modelType,
    "embedding": embedding,
    "n_ctx": nCtx,
    "n_batch": nBatch,
    "n_threads": nThreads,
    "n_gpu_layers": nGpuLayers,
    "use_mlock": useMlock,
    "use_mmap": useMmap,
    "lora": lora,
    "lora_scaled": loraScaled,
    "lora_init_without_apply": loraInitWithoutApply,
    "rope_freq_base": ropeFreqBase,
    "rope_freq_scale": ropeFreqScale,
    "emit_load_progress": emitLoadProgress
  });
}