Use Companion AI in llama.com by default

This commit is contained in:
Justine Tunney 2023-04-29 00:48:14 -07:00
parent d9e27203d4
commit 3dac9f8999
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 310 additions and 193 deletions

View file

@ -4,6 +4,7 @@
#ifndef LLAMA_UTIL_H
#define LLAMA_UTIL_H
#include "libc/calls/struct/rlimit.h"
#include "libc/dce.h"
#include "libc/fmt/fmt.h"
#include "libc/runtime/sysconf.h"
#include "libc/sysv/consts/madv.h"
@ -163,7 +164,7 @@ struct llama_mmap {
Die("mmap failed: %s", strerror(errno));
}
if (prefetch) {
if (prefetch && !IsWindows()) {
// Advise the kernel to preload the mapped memory
if (madvise(addr, file->size, MADV_WILLNEED)) {
fprintf(stderr, "warning: madvise(.., MADV_WILLNEED) failed: %s\n",