Skip to content

Commit e4647c7

Browse files
committed
Add use_mmap flag to server
1 parent 207ebbc commit e4647c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: llama_cpp/server/__main__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ class Settings(BaseSettings):
2929
model: str
3030
n_ctx: int = 2048
3131
n_batch: int = 8
32-
n_threads: int = ((os.cpu_count() or 2) // 2) or 1
32+
n_threads: int = max((os.cpu_count() or 2) // 2, 1)
3333
f16_kv: bool = True
3434
use_mlock: bool = False # This causes a silent failure on platforms that don't support mlock (e.g. Windows) took forever to figure out...
35+
use_mmap: bool = True
3536
embedding: bool = True
3637
last_n_tokens_size: int = 64
3738
logits_all: bool = False
@@ -54,6 +55,7 @@ class Settings(BaseSettings):
5455
settings.model,
5556
f16_kv=settings.f16_kv,
5657
use_mlock=settings.use_mlock,
58+
use_mmap=settings.use_mmap,
5759
embedding=settings.embedding,
5860
logits_all=settings.logits_all,
5961
n_threads=settings.n_threads,

0 commit comments

Comments
 (0)