Skip to content

Commit d35a1cf

Browse files
committed
Merge branch 'remoteManagement' into crokeso
2 parents d29ba6e + db84b7d commit d35a1cf

File tree

159 files changed

+3011
-1655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+3011
-1655
lines changed

.editorconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ indent_style = tab
2121
[prompts/*.txt]
2222
insert_final_newline = unset
2323

24-
[examples/server/public/*]
24+
[tools/server/public/*]
2525
indent_size = 2
2626

27-
[examples/server/public/deps_*]
27+
[tools/server/public/deps_*]
2828
trim_trailing_whitespace = unset
2929
indent_style = unset
3030
indent_size = unset
3131

32-
[examples/server/deps_*]
32+
[tools/server/deps_*]
3333
trim_trailing_whitespace = unset
3434
indent_style = unset
3535
indent_size = unset
3636

3737
[examples/llama.swiftui/llama.swiftui.xcodeproj/*]
3838
indent_style = tab
3939

40-
[examples/cvector-generator/*.txt]
40+
[tools/cvector-generator/*.txt]
4141
trim_trailing_whitespace = unset
4242
insert_final_newline = unset
4343

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ ppl-*.txt
9292
qnt-*.txt
9393
perf-*.txt
9494

95-
examples/jeopardy/results.txt
96-
9795
poetry.lock
9896
poetry.toml
9997

CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -847,59 +847,59 @@ add_library(common2
847847
common/common.h
848848
common/sampling.cpp
849849
common/sampling.h
850-
examples/llava/llava.cpp
851-
examples/llava/llava.h
852-
examples/llava/clip.cpp
853-
examples/llava/clip.h
850+
tools/llava/llava.cpp
851+
tools/llava/llava.h
852+
tools/llava/clip.cpp
853+
tools/llava/clip.h
854854
src/unicode.h
855855
src/unicode.cpp
856856
src/unicode-data.cpp
857857
otherarch/utils.cpp
858858
otherarch/utils.h)
859-
target_include_directories(common2 PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
859+
target_include_directories(common2 PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./tools ./common)
860860
target_compile_features(common2 PUBLIC cxx_std_17) # don't bump
861861
target_link_libraries(common2 PRIVATE ggml ${LLAMA_EXTRA_LIBS})
862862
set_target_properties(common2 PROPERTIES POSITION_INDEPENDENT_CODE ON)
863863

864864
add_library(sdtype_adapter
865865
otherarch/sdcpp/sdtype_adapter.cpp)
866-
target_include_directories(sdtype_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
866+
target_include_directories(sdtype_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./tools ./common)
867867
target_compile_features(sdtype_adapter PUBLIC cxx_std_17) # don't bump
868868
target_link_libraries(sdtype_adapter PRIVATE common2 ggml ${LLAMA_EXTRA_LIBS})
869869
set_target_properties(sdtype_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON)
870870

871871
add_library(whisper_adapter
872872
otherarch/whispercpp/whisper_adapter.cpp)
873-
target_include_directories(whisper_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/whispercpp ./examples ./common)
873+
target_include_directories(whisper_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/whispercpp ./tools ./common)
874874
target_compile_features(whisper_adapter PUBLIC cxx_std_17) # don't bump
875875
target_link_libraries(whisper_adapter PRIVATE common2 ggml ${LLAMA_EXTRA_LIBS})
876876
set_target_properties(whisper_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON)
877877

878878
add_library(tts_adapter
879879
otherarch/tts_adapter.cpp)
880-
target_include_directories(tts_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./examples ./common)
880+
target_include_directories(tts_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./tools ./common)
881881
target_compile_features(tts_adapter PUBLIC cxx_std_17) # don't bump
882882
target_link_libraries(tts_adapter PRIVATE common2 ggml ${LLAMA_EXTRA_LIBS})
883883
set_target_properties(tts_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON)
884884

885885
add_library(embeddings_adapter
886886
otherarch/embeddings_adapter.cpp)
887-
target_include_directories(embeddings_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./examples ./common)
887+
target_include_directories(embeddings_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./tools ./common)
888888
target_compile_features(embeddings_adapter PUBLIC cxx_std_17) # don't bump
889889
target_link_libraries(embeddings_adapter PRIVATE common2 ggml ${LLAMA_EXTRA_LIBS})
890890
set_target_properties(embeddings_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON)
891891

892892
add_library(gpttype_adapter
893893
gpttype_adapter.cpp)
894-
target_include_directories(gpttype_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
894+
target_include_directories(gpttype_adapter PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./tools ./common)
895895
target_compile_features(gpttype_adapter PUBLIC cxx_std_17) # don't bump
896896
target_link_libraries(gpttype_adapter PRIVATE common2 ggml ggml_v1 ggml_v2 ggml_v3 ${LLAMA_EXTRA_LIBS})
897897
set_target_properties(gpttype_adapter PROPERTIES POSITION_INDEPENDENT_CODE ON)
898898

899899
if (LLAMA_CUBLAS)
900900
set(TARGET koboldcpp_cublas)
901901
add_library(${TARGET} SHARED expose.cpp expose.h)
902-
target_include_directories(${TARGET} PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
902+
target_include_directories(${TARGET} PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./tools ./common)
903903
target_compile_features(${TARGET} PUBLIC cxx_std_17) # don't bump
904904
set_target_properties(${TARGET} PROPERTIES PREFIX "")
905905
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "koboldcpp_cublas")
@@ -919,7 +919,7 @@ endif()
919919
if (LLAMA_HIPBLAS)
920920
set(TARGET koboldcpp_hipblas)
921921
add_library(${TARGET} SHARED expose.cpp expose.h)
922-
target_include_directories(${TARGET} PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./examples ./common)
922+
target_include_directories(${TARGET} PUBLIC . ./ggml/include ./ggml/src ./ggml/src/ggml-cpu ./include ./otherarch ./otherarch/tools ./otherarch/sdcpp ./otherarch/sdcpp/thirdparty ./tools ./common)
923923
target_compile_features(${TARGET} PUBLIC cxx_std_17) # don't bump
924924
set_target_properties(${TARGET} PROPERTIES PREFIX "")
925925
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "koboldcpp_hipblas")

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ sgemm_failsafe.o: ggml/src/ggml-cpu/llamafile/sgemm.cpp ggml/src/ggml-cpu/llamaf
584584
#there's no intrinsics or special gpu ops used here, so we can have a universal object
585585
ggml-alloc.o: ggml/src/ggml-alloc.c ggml/include/ggml.h ggml/include/ggml-alloc.h
586586
$(CC) $(CFLAGS) -c $< -o $@
587-
llava.o: examples/llava/llava.cpp examples/llava/llava.h
587+
llava.o: tools/llava/llava.cpp tools/llava/llava.h
588588
$(CXX) $(CXXFLAGS) -c $< -o $@
589589
unicode.o: src/unicode.cpp src/unicode.h
590590
$(CXX) $(CXXFLAGS) -c $< -o $@
@@ -614,11 +614,11 @@ ggml-backend-reg_vulkan.o: ggml/src/ggml-backend-reg.cpp ggml/src/ggml-backend-i
614614
$(CXX) $(CXXFLAGS) $(VULKAN_FLAGS) -c $< -o $@
615615
ggml-backend-reg_cublas.o: ggml/src/ggml-backend-reg.cpp ggml/src/ggml-backend-impl.h ggml/include/ggml.h ggml/include/ggml-backend.h ggml/include/ggml-cpu.h
616616
$(CXX) $(CXXFLAGS) $(CUBLAS_FLAGS) $(HIPFLAGS) -c $< -o $@
617-
llavaclip_default.o: examples/llava/clip.cpp examples/llava/clip.h
617+
llavaclip_default.o: tools/llava/clip.cpp tools/llava/clip.h
618618
$(CXX) $(CXXFLAGS) -c $< -o $@
619-
llavaclip_cublas.o: examples/llava/clip.cpp examples/llava/clip.h
619+
llavaclip_cublas.o: tools/llava/clip.cpp tools/llava/clip.h
620620
$(CXX) $(CXXFLAGS) $(CUBLAS_FLAGS) $(HIPFLAGS) -c $< -o $@
621-
llavaclip_vulkan.o: examples/llava/clip.cpp examples/llava/clip.h
621+
llavaclip_vulkan.o: tools/llava/clip.cpp tools/llava/clip.h
622622
$(CXX) $(CXXFLAGS) $(VULKAN_FLAGS) -c $< -o $@
623623

624624
#this is only used for accelerate
@@ -737,17 +737,17 @@ cleanocuda:
737737
# rm -vrf ggml/src/ggml-cuda/template-instances/*.o
738738

739739
# useful tools
740-
main: examples/main/main.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
740+
main: tools/main/main.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
741741
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
742742
sdmain: otherarch/sdcpp/util.cpp otherarch/sdcpp/main.cpp otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/thirdparty/zip.c build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
743743
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
744744
whispermain: otherarch/whispercpp/main.cpp otherarch/whispercpp/whisper.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
745745
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
746-
ttsmain: examples/tts/tts.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
746+
ttsmain: tools/tts/tts.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
747747
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
748-
gguf-split: examples/gguf-split/gguf-split.cpp ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o build-info.h llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
748+
gguf-split: tools/gguf-split/gguf-split.cpp ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o build-info.h llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
749749
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
750-
mtmd-cli: examples/llava/mtmd-cli.cpp examples/llava/mtmd.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
750+
mtmd-cli: tools/llava/mtmd-cli.cpp tools/llava/mtmd.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL) $(OBJS)
751751
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
752752

753753
ggml/src/ggml-vulkan-shaders.cpp:
@@ -887,7 +887,7 @@ koboldcpp_vulkan_noavx2:
887887
endif
888888

889889
# tools
890-
quantize_gguf: examples/quantize/quantize.cpp ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL)
890+
quantize_gguf: tools/quantize/quantize.cpp ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL)
891891
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
892892
quantize_gptj: otherarch/tools/gptj_quantize.cpp otherarch/tools/common-ggml.cpp ggml_v3.o ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL)
893893
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
@@ -897,7 +897,7 @@ quantize_neox: otherarch/tools/neox_quantize.cpp otherarch/tools/common-ggml.cpp
897897
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
898898
quantize_mpt: otherarch/tools/mpt_quantize.cpp otherarch/tools/common-ggml.cpp ggml_v3.o ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL)
899899
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
900-
quantize_clip: examples/llava/clip.cpp examples/llava/clip.h examples/llava/quantclip.cpp ggml_v3.o ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL)
900+
quantize_clip: tools/llava/clip.cpp tools/llava/clip.h tools/quantclip.cpp ggml_v3.o ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o ggml-backend_default.o ggml-backend-reg_default.o $(OBJS_FULL)
901901
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
902902

903903
#window simple clinfo

common/arg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,14 +2213,14 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
22132213
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_NO_CONT_BATCHING"));
22142214
add_opt(common_arg(
22152215
{"--mmproj"}, "FILE",
2216-
"path to a multimodal projector file. see examples/llava/README.md",
2216+
"path to a multimodal projector file. see tools/llava/README.md",
22172217
[](common_params & params, const std::string & value) {
22182218
params.mmproj.path = value;
22192219
}
22202220
).set_examples(mmproj_examples));
22212221
add_opt(common_arg(
22222222
{"--mmproj-url"}, "URL",
2223-
"URL to a multimodal projector file. see examples/llava/README.md",
2223+
"URL to a multimodal projector file. see tools/llava/README.md",
22242224
[](common_params & params, const std::string & value) {
22252225
params.mmproj.url = value;
22262226
}

common/common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ struct common_params {
336336

337337
common_conversation_mode conversation_mode = COMMON_CONVERSATION_MODE_AUTO;
338338

339-
// multimodal models (see examples/llava)
339+
// multimodal models (see tools/llava)
340340
struct common_params_model mmproj;
341341
bool mmproj_use_gpu = true; // use GPU for multimodal model
342342
bool no_mmproj = false; // explicitly disable multimodal model
@@ -410,8 +410,8 @@ struct common_params {
410410
int n_pca_batch = 100;
411411
int n_pca_iterations = 1000;
412412
dimre_method cvector_dimre_method = DIMRE_METHOD_PCA;
413-
std::string cvector_positive_file = "examples/cvector-generator/positive.txt";
414-
std::string cvector_negative_file = "examples/cvector-generator/negative.txt";
413+
std::string cvector_positive_file = "tools/cvector-generator/positive.txt";
414+
std::string cvector_negative_file = "tools/cvector-generator/negative.txt";
415415

416416
bool spm_infill = false; // suffix/prefix/middle pattern for infill
417417

0 commit comments

Comments
 (0)