diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 8733d5feb..b53c16f51 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -549,7 +549,7 @@ int main(int argc, char ** argv) { llama_token_data_array candidates_p = { candidates.data(), candidates.size(), false }; if (guidance_ctx) { - llama_sample_context_free_guidance(ctx, &candidates_p, guidance_ctx, params.cfg_scale, params.cfg_smooth_factor); + llama_sample_classifier_free_guidance(ctx, &candidates_p, guidance_ctx, params.cfg_scale, params.cfg_smooth_factor); } // Apply penalties diff --git a/llama.cpp b/llama.cpp index 5a8c6cf3b..f96c9d143 100644 --- a/llama.cpp +++ b/llama.cpp @@ -2157,7 +2157,7 @@ void llama_log_softmax(T * array, int size, LogitAccessor logit_accessor) { } } -void llama_sample_context_free_guidance( +void llama_sample_classifier_free_guidance( struct llama_context * ctx, llama_token_data_array * candidates, struct llama_context * guidance_ctx, diff --git a/llama.h b/llama.h index efac46ea8..8789ce6ea 100644 --- a/llama.h +++ b/llama.h @@ -312,7 +312,7 @@ extern "C" { /// @params guidance_ctx A separate context from the same model. Other than a negative prompt at the beginning, it should have all generated and user input tokens copied from the main context. /// @params scale Guidance strength. 1.0f means no guidance. Higher values mean stronger guidance. /// @params smooth_factor Smooth factor between guidance logits and original logits. 1.0f means only use guidance logits. 0.0f means only original logits. - LLAMA_API void llama_sample_context_free_guidance( + LLAMA_API void llama_sample_classifier_free_guidance( struct llama_context * ctx, llama_token_data_array * candidates, struct llama_context * guidance_ctx,