Skip to content

Commit e683b9a

Browse files
committed
attemp to fix compile problem on mac
1 parent 7297817 commit e683b9a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BUILD_TARGETS = \
33
main quantize quantize-stats perplexity imatrix embedding vdot q8dot train-text-from-scratch convert-llama2c-to-ggml \
44
simple batched batched-bench save-load-state server gguf gguf-split eval-callback llama-bench libllava.a llava-cli baby-llama \
55
retrieval speculative infill tokenize benchmark-matmult parallel finetune export-lora lookahead lookup passkey gritlm \
6-
tests/test-c.o control-vector-generator
6+
control-vector-generator tests/test-c.o
77

88
# Binaries only useful for tests
99
TEST_TARGETS = \
@@ -874,7 +874,7 @@ eval-callback: examples/eval-callback/eval-callback.cpp ggml.o llama.o $(COMMON_
874874
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
875875
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
876876

877-
control-vector-generator: examples/control-vector-generator/control-vector-generator.cpp examples/control-vector-generator/pca.hpp ggml.o llama.o $(COMMON_DEPS) $(OBJS)
877+
control-vector-generator: examples/control-vector-generator/control-vector-generator.cpp ggml.o llama.o $(COMMON_DEPS) $(OBJS)
878878
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
879879
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
880880

examples/control-vector-generator/control-vector-generator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,11 @@ int main(int argc, char ** argv) {
603603
cb_data.n_layers = n_layers;
604604
cb_data.n_tokens = t.max_seq_len;
605605

606-
printf("Evaluating prompt[%ld/%ld]: \"%s\" - \"%s\" (%ld tokens)\n",
607-
i+1, cparams.positive_entries.size(),
606+
printf("Evaluating prompt[%d/%d]: \"%s\" - \"%s\" (%d tokens)\n",
607+
(int) i+1, (int) cparams.positive_entries.size(),
608608
tokens_to_str(ctx, t.tokens_pos.cbegin(), t.tokens_pos.cend()).c_str(),
609609
tokens_to_str(ctx, t.tokens_neg.cbegin(), t.tokens_neg.cend()).c_str(),
610-
t.max_seq_len);
610+
(int) t.max_seq_len);
611611

612612
cb_data.is_eval_pos = true;
613613
get_hidden_layers(ctx, t.tokens_pos);

examples/control-vector-generator/pca.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define DEBUG_POS 5
2222

2323
static void print_debug_tensor(struct ggml_tensor * t, bool with_data = true) {
24-
printf("%s: %s (%s): [%ld, %ld]\n", __func__, t->name, ggml_type_name(t->type), (size_t) t->ne[0], (size_t) t->ne[1]);
24+
printf("%s: %s (%s): [%d, %d]\n", __func__, t->name, ggml_type_name(t->type), (int) t->ne[0], (int) t->ne[1]);
2525
if (!with_data) return;
2626
printf("%s: %s[0] = [", __func__, t->name);
2727
for (size_t i = 0; i <= DEBUG_POS; i++) {
@@ -325,7 +325,7 @@ static void run_pca(
325325
params.i_layer = il;
326326
params.n_layers = v_input.size();
327327
power_iteration(params, v_input[il], ctrl_out);
328-
printf("%s: Done layer %ld / %ld\n", __func__, il+1, v_input.size());
328+
printf("%s: Done layer %d / %d\n", __func__, (int) il+1, v_input.size());
329329
//print_debug_tensor(ctrl_out);
330330
}
331331
}

0 commit comments

Comments
 (0)