Skip to content

Commit 1c2f0f7

Browse files
committed
fix save slot test
1 parent 6af3f95 commit 1c2f0f7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/server/tests/unit/test_slot_save.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def create_server():
88
global server
99
server = ServerPreset.tinyllama2()
1010
server.slot_save_path = "./tmp"
11+
server.temperature = 0.0
1112

1213

1314
def test_slot_save_restore():
@@ -21,7 +22,7 @@ def test_slot_save_restore():
2122
"cache_prompt": True,
2223
})
2324
assert res.status_code == 200
24-
assert match_regex("(Lily|cake)+", res.body["content"])
25+
assert match_regex("(Whiskers|Flana)+", res.body["content"])
2526
assert res.body["timings"]["prompt_n"] == 21 # all tokens are processed
2627

2728
# Save state of slot 1
@@ -79,7 +80,7 @@ def test_slot_erase():
7980
"cache_prompt": True,
8081
})
8182
assert res.status_code == 200
82-
assert match_regex("(Lily|cake)+", res.body["content"])
83+
assert match_regex("(Whiskers|Flana)+", res.body["content"])
8384
assert res.body["timings"]["prompt_n"] == 21 # all tokens are processed
8485

8586
# erase slot 1
@@ -93,5 +94,5 @@ def test_slot_erase():
9394
"cache_prompt": True,
9495
})
9596
assert res.status_code == 200
96-
assert match_regex("(Lily|cake)+", res.body["content"])
97+
assert match_regex("(Whiskers|Flana)+", res.body["content"])
9798
assert res.body["timings"]["prompt_n"] == 21 # all tokens are processed

examples/server/tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ServerProcess:
4747
model_url: str | None = None
4848
model_file: str | None = None
4949
n_threads: int | None = None
50-
n_gpu_layer: str | None = None
50+
n_gpu_layer: int | None = None
5151
n_batch: int | None = None
5252
n_ubatch: int | None = None
5353
n_ctx: int | None = None

0 commit comments

Comments
 (0)