update the package

This commit is contained in:
kchro3 2023-09-03 12:38:09 -07:00
parent 6a31a3bd98
commit 5e4063a508
4 changed files with 13 additions and 2 deletions

View file

@ -16,13 +16,18 @@ let package = Package(
"ggml.c", "ggml.c",
"llama.cpp", "llama.cpp",
"ggml-alloc.c", "ggml-alloc.c",
"k_quants.c" "k_quants.c",
"common/common.cpp",
"common/console.cpp",
"common/grammar-parser.cpp",
], ],
publicHeadersPath: "spm-headers", publicHeadersPath: "spm-headers",
cSettings: [ cSettings: [
.headerSearchPath("common"),
.unsafeFlags(["-Wno-shorten-64-to-32"]), .unsafeFlags(["-Wno-shorten-64-to-32"]),
.define("GGML_USE_K_QUANTS"), .define("GGML_USE_K_QUANTS"),
.define("GGML_USE_ACCELERATE") .define("GGML_USE_ACCELERATE"),
.define("LLAMA_USE_SWIFT")
], ],
linkerSettings: [ linkerSettings: [
.linkedFramework("Accelerate") .linkedFramework("Accelerate")

View file

@ -1,5 +1,7 @@
#include "common.h" #include "common.h"
#ifndef LLAMA_USE_SWIFT
#include "build-info.h" #include "build-info.h"
#endif
#include "llama.h" #include "llama.h"
#include <algorithm> #include <algorithm>
@ -971,8 +973,10 @@ std::string get_sortable_timestamp() {
void dump_non_result_info_yaml(FILE * stream, const gpt_params & params, const llama_context * lctx, void dump_non_result_info_yaml(FILE * stream, const gpt_params & params, const llama_context * lctx,
const std::string & timestamp, const std::vector<int> & prompt_tokens, const char * model_desc) { const std::string & timestamp, const std::vector<int> & prompt_tokens, const char * model_desc) {
#ifndef LLAMA_USE_SWIFT
fprintf(stream, "build_commit: %s\n", BUILD_COMMIT); fprintf(stream, "build_commit: %s\n", BUILD_COMMIT);
fprintf(stream, "build_number: %d\n", BUILD_NUMBER); fprintf(stream, "build_number: %d\n", BUILD_NUMBER);
#endif
fprintf(stream, "cpu_has_arm_fma: %s\n", ggml_cpu_has_arm_fma() ? "true" : "false"); fprintf(stream, "cpu_has_arm_fma: %s\n", ggml_cpu_has_arm_fma() ? "true" : "false");
fprintf(stream, "cpu_has_avx: %s\n", ggml_cpu_has_avx() ? "true" : "false"); fprintf(stream, "cpu_has_avx: %s\n", ggml_cpu_has_avx() ? "true" : "false");
fprintf(stream, "cpu_has_avx2: %s\n", ggml_cpu_has_avx2() ? "true" : "false"); fprintf(stream, "cpu_has_avx2: %s\n", ggml_cpu_has_avx2() ? "true" : "false");

1
spm-headers/common.h Symbolic link
View file

@ -0,0 +1 @@
../common/common.h

1
spm-headers/log.h Symbolic link
View file

@ -0,0 +1 @@
../common/log.h