Skip to content

Commit c7741f5

Browse files
Fix API compatibility issues in test-quantize-stats.cpp
- Use ggml_get_type_traits_cpu for from_float check - Add void casts for unused parameters in placeholder function - Remove deprecated llama_n_vocab call Co-Authored-By: Alex Peng <[email protected]>
1 parent 773dfd1 commit c7741f5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test-quantize-stats.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,17 @@ static void compare_perplexity_across_formats(
197197
const std::vector<int> & test_tokens,
198198
const std::vector<ggml_type> & quant_types
199199
) {
200+
(void)model;
201+
(void)ctx;
202+
(void)test_tokens;
203+
200204
printf("\n=== Perplexity Comparison Across Quantization Formats ===\n");
201205
printf("Note: Lower perplexity indicates better model quality\n\n");
202206

203-
const int n_vocab = llama_n_vocab(model);
204-
std::vector<int> targets(test_tokens.begin() + 1, test_tokens.end());
205-
206207
for (ggml_type qtype : quant_types) {
208+
const auto * qfns_cpu = ggml_get_type_traits_cpu(qtype);
207209
const auto * qfns = ggml_get_type_traits(qtype);
208-
if (!qfns->from_float || !qfns->to_float) continue;
210+
if (!qfns_cpu->from_float || !qfns->to_float) continue;
209211

210212
printf("%-12s: perplexity calculation requires model inference\n", ggml_type_name(qtype));
211213
}

0 commit comments

Comments
 (0)