Skip to content

Commit

Permalink
Upgrade to Cosmo v3.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Nov 23, 2024
1 parent 38a77c8 commit fb59488
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions build/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘

PREFIX = /usr/local
COSMOCC = .cosmocc/3.9.6
COSMOCC = .cosmocc/3.9.7
TOOLCHAIN = $(COSMOCC)/bin/cosmo

CC = $(TOOLCHAIN)cc
Expand Down Expand Up @@ -52,5 +52,5 @@ clean:; rm -rf o
.PHONY: distclean
distclean:; rm -rf o .cosmocc

.cosmocc/3.9.6:
build/download-cosmocc.sh $@ 3.9.6 cb9611df6aa156f0bd94a10976dbd694cf137985d70a963be717e1cfb66fa19e
.cosmocc/3.9.7:
build/download-cosmocc.sh $@ 3.9.7 3f559555d08ece35bab1a66293a2101f359ac9841d563419756efa9c79f7a150
2 changes: 1 addition & 1 deletion llama.cpp/llama-bench/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main(int argc, char ** argv) {

llamafile_check_cpu();
ShowCrashReports();
LoadZipArgs(&argc, &argv);
argc = cosmo_args("/zip/.args", &argv);
launch_sigint_thread();

if (!llamafile_has(argv, "--cli") &&
Expand Down
9 changes: 3 additions & 6 deletions llama.cpp/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ static std::vector<llama_token> * g_output_tokens;
static bool is_interacting = false;
static bool need_insert_eot = false;

extern "C" int nsync_futex_wake_(int *, int, char);
extern "C" int nsync_futex_wait_(int *, int, char, int, const struct timespec *);

static bool file_exists(const std::string & path) {
std::ifstream f(path.c_str());
return f.good();
Expand Down Expand Up @@ -100,7 +97,7 @@ static int is_killed;

static void *safe_sigint_handler(void *arg) {
while (!is_killed)
nsync_futex_wait_(&is_killed, 0, 0, 0, 0);
cosmo_futex_wait(&is_killed, 0, 0, 0, 0);
console::cleanup();
printf("\n");
llama_print_timings(*g_ctx);
Expand All @@ -125,7 +122,7 @@ static void sigint_handler(int signo) {
is_interacting = true;
} else {
is_killed = true;
nsync_futex_wake_(&is_killed, 1, 0);
cosmo_futex_wake(&is_killed, 1, 0);
for (;;) {
}
}
Expand Down Expand Up @@ -191,7 +188,7 @@ int main(int argc, char ** argv) {

llamafile_check_cpu();
ShowCrashReports();
LoadZipArgs(&argc, &argv);
argc = cosmo_args("/zip/.args", &argv);

enum Program prog = determine_program(argv);

Expand Down
2 changes: 1 addition & 1 deletion llamafile/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ main(int argc, char* argv[])
}

// get config
LoadZipArgs(&argc, &argv);
argc = cosmo_args("/zip/.args", &argv);
llamafile_get_flags(argc, argv);

// initialize subsystems
Expand Down
2 changes: 1 addition & 1 deletion llamafile/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main(int argc, char **argv) {

FLAG_log_disable = true;

LoadZipArgs(&argc, &argv);
argc = cosmo_args("/zip/.args", &argv);
llamafile_get_flags(argc, argv);

llama_model_params mparams = {
Expand Down
2 changes: 1 addition & 1 deletion whisper.cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ int main(int argc, char ** argv) {
__builtin_unreachable();
}

LoadZipArgs(&argc, &argv);
argc = cosmo_args("/zip/.args", &argv);

if (!llamafile_has(argv, "--cli") &&
(llamafile_has(argv, "--server") ||
Expand Down

0 comments on commit fb59488

Please sign in to comment.