setSamplingParams method

void setSamplingParams(
  1. int top_k,
  2. double top_p,
  3. double temp,
  4. int dist
)

Implementation

void setSamplingParams(int top_k, double top_p, double temp, int dist) {
  if (pLLm == nullptr) {
    throw Exception("ailia LLM not initialized.");
  }

  var status = dllHandle.ailiaLLMSetSamplingParams(
      pLLm.value, top_k, top_p, temp, dist);
  if (status != ailia_llm_dart.AILIA_LLM_STATUS_SUCCESS) {
    throw Exception("ailiaLLMGenerate returned an error status $status");
  }
}