@@ -251,12 +251,12 @@ enum common_speculative_type common_speculative_type_from_name(const std::string
251251
252252
253253struct common_speculative * common_speculative_init (
254- struct common_params & params,
254+ struct common_params_speculative & params,
255255 struct llama_context * ctx_tgt,
256256 struct llama_context * ctx_dft
257257 ) {
258258 std::vector<std::unique_ptr<common_speculative_state>> implementations = {};
259- for (const common_speculative_config & config : params.speculative . configs ) {
259+ for (const common_speculative_config & config : params.configs ) {
260260 LOG_INF (" common_speculative_init: adding implementation %s\n " , common_speculative_type_to_str (config.type ).c_str ());
261261 switch (config.type ) {
262262 case COMMON_SPECULATIVE_TYPE_NONE:
@@ -271,7 +271,7 @@ struct common_speculative * common_speculative_init(
271271 }
272272 case COMMON_SPECULATIVE_TYPE_NGRAM_SIMPLE: {
273273 common_ngram_map ngram_map = get_common_ngram_map (config,
274- params.speculative . spec_ngram_size_n , params. speculative .spec_ngram_size_m );
274+ params.spec_ngram_size_n , params.spec_ngram_size_m );
275275 uint16_t ngram_size_key = ngram_map.size_key ;
276276 uint16_t mgram_size_value = ngram_map.size_value ;
277277 uint16_t check_rate = ngram_map.check_rate ;
@@ -287,14 +287,14 @@ struct common_speculative * common_speculative_init(
287287 case COMMON_SPECULATIVE_TYPE_NGRAM_MAP_K: {
288288 implementations.push_back (std::make_unique<common_speculative_state_ngram_map_k>(
289289 (config.type ), get_common_ngram_map (config,
290- params.speculative . spec_ngram_size_n , params. speculative .spec_ngram_size_m )
290+ params.spec_ngram_size_n , params.spec_ngram_size_m )
291291 ));
292292 break ;
293293 }
294294 case COMMON_SPECULATIVE_TYPE_NGRAM_MAP_K4V: {
295295 implementations.push_back (std::make_unique<common_speculative_state_ngram_map_k4v>(
296296 (config.type ), get_common_ngram_map (config,
297- params.speculative . spec_ngram_size_n , params. speculative .spec_ngram_size_m )));
297+ params.spec_ngram_size_n , params.spec_ngram_size_m )));
298298 break ;
299299 }
300300 case COMMON_SPECULATIVE_TYPE_NGRAM_CACHE: {
@@ -746,7 +746,7 @@ llama_tokens common_speculative_use_draft_model(
746746 return result;
747747}
748748
749- void common_speculative_send_accepted (struct common_speculative * spec, const uint16_t n_accepted) {
749+ void common_speculative_accept (struct common_speculative * spec, const uint16_t n_accepted) {
750750 common_speculative_state * impl = spec->curr_impl ;
751751 if (impl != nullptr ) {
752752 if (n_accepted > 0 ) {
@@ -756,7 +756,7 @@ void common_speculative_send_accepted(struct common_speculative * spec, const ui
756756 if (impl->type == COMMON_SPECULATIVE_TYPE_NGRAM_MAP_K ||
757757 impl->type == COMMON_SPECULATIVE_TYPE_NGRAM_MAP_K4V) {
758758 auto state = static_cast <struct common_speculative_state_ngram_map_k *>(impl);
759- common_ngram_map_send_accepted (state->map , n_accepted);
759+ common_ngram_map_accept (state->map , n_accepted);
760760 }
761761 }
762762}
0 commit comments