feat(backend): add missing temperature parameter
This commit is contained in:
parent
df72c56b5b
commit
9d659f1e23
|
@ -37,6 +37,7 @@ namespace huggingface::tgi::backends::llamacpp {
|
|||
llama_sampler_chain_add(pSampler, llama_sampler_init_top_p(top_p, 1));
|
||||
}
|
||||
|
||||
llama_sampler_chain_add(pSampler, llama_sampler_init_temp(temperature));
|
||||
llama_sampler_chain_add(pSampler, llama_sampler_init_dist(seed));
|
||||
return {pSampler, llama_sampler_deleter};
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ namespace huggingface::tgi::backends::llamacpp {
|
|||
float_t top_p = 1.0f;
|
||||
float_t frequency_penalty = 0.0f;
|
||||
float_t repetition_penalty = 0.0f;
|
||||
float_t temperature = 0.0f;
|
||||
uint64_t seed = 2014;
|
||||
|
||||
/**
|
||||
|
|
|
@ -104,6 +104,7 @@ impl From<&ValidParameters> for SamplingParams {
|
|||
top_p: v.top_p,
|
||||
frequency_penalty: v.frequency_penalty,
|
||||
repetition_penalty: v.repetition_penalty,
|
||||
temperature: v.temperature,
|
||||
seed: v.seed,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ impl Default for SamplingParams {
|
|||
top_p: 1.0f32,
|
||||
frequency_penalty: 0.0f32,
|
||||
repetition_penalty: 0.0f32,
|
||||
temperature: 1.0f32,
|
||||
seed: 2014u64,
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +30,7 @@ mod ffi {
|
|||
top_p: f32,
|
||||
frequency_penalty: f32,
|
||||
repetition_penalty: f32,
|
||||
temperature: f32,
|
||||
seed: u64,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue