@@ -130,10 +130,10 @@ std::string common_sampler_params::print() const {
130130
131131 snprintf (result, sizeof (result),
132132 " \t repeat_last_n = %d, repeat_penalty = %.3f, frequency_penalty = %.3f, presence_penalty = %.3f\n "
133- " \t top_k = %d, tfs_z = %.3f, top_p = %.3f, min_p = %.3f, typical_p = %.3f, temp = %.3f\n "
133+ " \t top_k = %d, tfs_z = %.3f, top_p = %.3f, min_p = %.3f, xtc_probability = %.3f, xtc_threshold = %.3f, typical_p = %.3f, temp = %.3f\n "
134134 " \t mirostat = %d, mirostat_lr = %.3f, mirostat_ent = %.3f" ,
135135 penalty_last_n, penalty_repeat, penalty_freq, penalty_present,
136- top_k, tfs_z, top_p, min_p, typ_p, temp,
136+ top_k, tfs_z, top_p, min_p, xtc_probability, xtc_threshold, typ_p, temp,
137137 mirostat, mirostat_eta, mirostat_tau);
138138
139139 return std::string (result);
@@ -184,6 +184,9 @@ struct common_sampler * common_sampler_init(const struct llama_model * model, co
184184 case COMMON_SAMPLER_TYPE_MIN_P:
185185 llama_sampler_chain_add (result->chain , llama_sampler_init_min_p (params.min_p , params.min_keep ));
186186 break ;
187+ case COMMON_SAMPLER_TYPE_XTC:
188+ llama_sampler_chain_add (result->chain , llama_sampler_init_xtc (params.xtc_probability , params.xtc_threshold , params.min_keep , params.seed ));
189+ break ;
187190 case COMMON_SAMPLER_TYPE_TFS_Z:
188191 llama_sampler_chain_add (result->chain , llama_sampler_init_tail_free (params.tfs_z , params.min_keep ));
189192 break ;
@@ -193,6 +196,9 @@ struct common_sampler * common_sampler_init(const struct llama_model * model, co
193196 case COMMON_SAMPLER_TYPE_TEMPERATURE:
194197 llama_sampler_chain_add (result->chain , llama_sampler_init_temp_ext (params.temp , params.dynatemp_range , params.dynatemp_exponent ));
195198 break ;
199+ case COMMON_SAMPLER_TYPE_INFILL:
200+ llama_sampler_chain_add (result->chain , llama_sampler_init_infill (model));
201+ break ;
196202 default :
197203 GGML_ASSERT (false && " unknown sampler type" );
198204 }
@@ -372,6 +378,8 @@ char common_sampler_type_to_chr(enum common_sampler_type cnstr) {
372378 case COMMON_SAMPLER_TYPE_TOP_P: return ' p' ;
373379 case COMMON_SAMPLER_TYPE_MIN_P: return ' m' ;
374380 case COMMON_SAMPLER_TYPE_TEMPERATURE: return ' t' ;
381+ case COMMON_SAMPLER_TYPE_XTC: return ' x' ;
382+ case COMMON_SAMPLER_TYPE_INFILL: return ' i' ;
375383 default : return ' ?' ;
376384 }
377385}
@@ -384,6 +392,8 @@ std::string common_sampler_type_to_str(enum common_sampler_type cnstr) {
384392 case COMMON_SAMPLER_TYPE_TOP_P: return " top_p" ;
385393 case COMMON_SAMPLER_TYPE_MIN_P: return " min_p" ;
386394 case COMMON_SAMPLER_TYPE_TEMPERATURE: return " temperature" ;
395+ case COMMON_SAMPLER_TYPE_XTC: return " xtc" ;
396+ case COMMON_SAMPLER_TYPE_INFILL: return " infill" ;
387397 default : return " " ;
388398 }
389399}
@@ -396,6 +406,8 @@ std::vector<common_sampler_type> common_sampler_types_from_names(const std::vect
396406 { " min_p" , COMMON_SAMPLER_TYPE_MIN_P },
397407 { " tfs_z" , COMMON_SAMPLER_TYPE_TFS_Z },
398408 { " temperature" , COMMON_SAMPLER_TYPE_TEMPERATURE },
409+ { " xtc" , COMMON_SAMPLER_TYPE_XTC },
410+ { " infill" , COMMON_SAMPLER_TYPE_INFILL },
399411 };
400412
401413 // since samplers names are written multiple ways
@@ -441,7 +453,9 @@ std::vector<common_sampler_type> common_sampler_types_from_chars(const std::stri
441453 { common_sampler_type_to_chr (COMMON_SAMPLER_TYPE_TYPICAL_P), COMMON_SAMPLER_TYPE_TYPICAL_P },
442454 { common_sampler_type_to_chr (COMMON_SAMPLER_TYPE_TOP_P), COMMON_SAMPLER_TYPE_TOP_P },
443455 { common_sampler_type_to_chr (COMMON_SAMPLER_TYPE_MIN_P), COMMON_SAMPLER_TYPE_MIN_P },
444- { common_sampler_type_to_chr (COMMON_SAMPLER_TYPE_TEMPERATURE), COMMON_SAMPLER_TYPE_TEMPERATURE }
456+ { common_sampler_type_to_chr (COMMON_SAMPLER_TYPE_TEMPERATURE), COMMON_SAMPLER_TYPE_TEMPERATURE },
457+ { common_sampler_type_to_chr (COMMON_SAMPLER_TYPE_XTC), COMMON_SAMPLER_TYPE_XTC },
458+ { common_sampler_type_to_chr (COMMON_SAMPLER_TYPE_INFILL), COMMON_SAMPLER_TYPE_INFILL },
445459 };
446460
447461 std::vector<common_sampler_type> samplers;
0 commit comments