mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-20 09:38:43 +02:00
expose seed to api
This commit is contained in:
@@ -802,6 +802,8 @@ Returns raw audio bytes (`audio/wav` by default) rather than JSON. For more info
|
||||
|
||||
`repeat_penalty`: Repetition penalty applied to the backbone sampler over the whole generation (default `1.05`). Without this, the backbone can loop and re-generate the same utterance.
|
||||
|
||||
`seed`: RNG seed for both the backbone sampler and the codec/vocoder (`-1` = random, the default). Set to a fixed value for reproducible output.
|
||||
|
||||
`n_predict`: Max number of audio frames to generate. Defaults to `512`; generation normally stops earlier once the model emits an end-of-speech token.
|
||||
|
||||
`response_format`: `wav` (default) or `pcm` (raw `float32` samples, no header).
|
||||
|
||||
@@ -5241,6 +5241,8 @@ void server_routes::init_routes() {
|
||||
task.params.sampling = params.sampling; // baseline defaults, then apply overrides below
|
||||
task.params.sampling.penalty_repeat = json_value(body, "repeat_penalty", 1.05f);
|
||||
task.params.sampling.penalty_last_n = -1;
|
||||
task.params.sampling.seed = json_value(body, "seed", params.sampling.seed);
|
||||
task.tts_inp.data.seed = task.params.sampling.seed; // same seed for the codec/vocoder RNG
|
||||
if (task.tts_inp.data.top_k > 0) {
|
||||
task.params.sampling.top_k = task.tts_inp.data.top_k;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user