We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a00e45 commit 5a3413eCopy full SHA for 5a3413e
llama_cpp/server/app.py
@@ -1,8 +1,8 @@
1
-import os
2
import json
+import multiprocessing
3
from threading import Lock
4
from typing import List, Optional, Union, Iterator, Dict
5
-from typing_extensions import TypedDict, Literal, Annotated
+from typing_extensions import TypedDict, Literal
6
7
import llama_cpp
8
@@ -21,7 +21,7 @@ class Settings(BaseSettings):
21
default=512, ge=1, description="The batch size to use per eval."
22
)
23
n_threads: int = Field(
24
- default=max((os.cpu_count() or 2) // 2, 1),
+ default=max(multiprocessing.cpu_count() // 2, 1),
25
ge=1,
26
description="The number of threads to use.",
27
0 commit comments