Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions llama.cpp/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,16 @@ int main(int argc, char ** argv) {
__builtin_unreachable();
}

enum Program prog = determine_program(argv);
if (prog == LLAMAFILER)
return lf::server::main(argc, argv);

mallopt(M_GRANULARITY, 2 * 1024 * 1024);
mallopt(M_MMAP_THRESHOLD, 16 * 1024 * 1024);
mallopt(M_TRIM_THRESHOLD, 128 * 1024 * 1024);
ShowCrashReports();
argc = cosmo_args("/zip/.args", &argv);

enum Program prog = determine_program(argv);
if (prog == LLAMAFILER)
return lf::server::run(argc, argv, true);

if (prog == SERVER)
return server_cli(argc, 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 @@ -20,5 +20,5 @@
int
main(int argc, char* argv[])
{
return lf::server::main(argc, argv);
return lf::server::run(argc, argv, false);
}
5 changes: 3 additions & 2 deletions llamafile/server/prog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace server {
Server* g_server;

int
main(int argc, char* argv[])
run(int argc, char* argv[], bool args_already_loaded)
{
llamafile_check_cpu();
signal(SIGPIPE, SIG_IGN);
Expand All @@ -56,7 +56,8 @@ main(int argc, char* argv[])
}

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

// initialize subsystems
Expand Down
2 changes: 1 addition & 1 deletion llamafile/server/prog.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace lf {
namespace server {

int
main(int, char**);
run(int, char**, bool);

} // namespace server
} // namespace lf