Skip to content

Commit c2e690b

Browse files
authored
Merge pull request #29 from MillionthOdin16/main
Fixes and Tweaks to Defaults
2 parents 38f7dea + 2e91aff commit c2e690b

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,4 @@ cython_debug/
163163
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
164164
# and can be added to the global gitignore or merged into this file. For a more nuclear
165165
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
166-
#.idea/
166+
.idea/

examples/high_level_api/fastapi_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
class Settings(BaseSettings):
2828
model: str
2929
n_ctx: int = 2048
30-
n_batch: int = 2048
31-
n_threads: int = os.cpu_count() or 1
30+
n_batch: int = 8
31+
n_threads: int = int(os.cpu_count() / 2) or 1
3232
f16_kv: bool = True
33-
use_mlock: bool = True
33+
use_mlock: bool = False # This causes a silent failure on platforms that don't support mlock (e.g. Windows) took forever to figure out...
3434
embedding: bool = True
3535
last_n_tokens_size: int = 64
3636

llama_cpp/server/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
class Settings(BaseSettings):
2828
model: str
2929
n_ctx: int = 2048
30-
n_batch: int = 2048
31-
n_threads: int = os.cpu_count() or 1
30+
n_batch: int = 8
31+
n_threads: int = int(os.cpu_count() / 2) or 1
3232
f16_kv: bool = True
33-
use_mlock: bool = True
33+
use_mlock: bool = False # This causes a silent failure on platforms that don't support mlock (e.g. Windows) took forever to figure out...
3434
embedding: bool = True
3535
last_n_tokens_size: int = 64
3636

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
entry_points={"console_scripts": ["llama_cpp.server=llama_cpp.server:main"]},
2020
install_requires=[
2121
"typing-extensions>=4.5.0",
22+
"pydantic==1.10.7",
2223
],
2324
extras_require={
2425
"server": ["uvicorn>=0.21.1", "fastapi>=0.95.0", "sse-starlette>=1.3.3"],

0 commit comments

Comments
 (0)