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 5a3413e

Browse filesBrowse files
committed
Update cpu_count
1 parent 1a00e45 commit 5a3413e
Copy full SHA for 5a3413e

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+3
-3
lines changed

‎llama_cpp/server/app.py

Copy file name to clipboardExpand all lines: llama_cpp/server/app.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import os
21
import json
2+
import multiprocessing
33
from threading import Lock
44
from typing import List, Optional, Union, Iterator, Dict
5-
from typing_extensions import TypedDict, Literal, Annotated
5+
from typing_extensions import TypedDict, Literal
66

77
import llama_cpp
88

@@ -21,7 +21,7 @@ class Settings(BaseSettings):
2121
default=512, ge=1, description="The batch size to use per eval."
2222
)
2323
n_threads: int = Field(
24-
default=max((os.cpu_count() or 2) // 2, 1),
24+
default=max(multiprocessing.cpu_count() // 2, 1),
2525
ge=1,
2626
description="The number of threads to use.",
2727
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.