Skip to content

Commit 5a3413e

Browse files
committed
Update cpu_count
1 parent 1a00e45 commit 5a3413e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llama_cpp/server/app.py

Lines 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)