Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e4647c7

Browse filesBrowse files
committed
Add use_mmap flag to server
1 parent 207ebbc commit e4647c7
Copy full SHA for e4647c7

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎llama_cpp/server/__main__.py

Copy file name to clipboardExpand all lines: llama_cpp/server/__main__.py
+3-1Lines changed: 3 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.