fix save slot test

This commit is contained in:
Xuan Son Nguyen 2024-11-20 19:24:24 +01:00
parent 6af3f95f6f
commit 1c2f0f708c
2 changed files with 5 additions and 4 deletions

View file

@ -8,6 +8,7 @@ def create_server():
global server
server = ServerPreset.tinyllama2()
server.slot_save_path = "./tmp"
server.temperature = 0.0
def test_slot_save_restore():
@ -21,7 +22,7 @@ def test_slot_save_restore():
"cache_prompt": True,
})
assert res.status_code == 200
assert match_regex("(Lily|cake)+", res.body["content"])
assert match_regex("(Whiskers|Flana)+", res.body["content"])
assert res.body["timings"]["prompt_n"] == 21 # all tokens are processed
# Save state of slot 1
@ -79,7 +80,7 @@ def test_slot_erase():
"cache_prompt": True,
})
assert res.status_code == 200
assert match_regex("(Lily|cake)+", res.body["content"])
assert match_regex("(Whiskers|Flana)+", res.body["content"])
assert res.body["timings"]["prompt_n"] == 21 # all tokens are processed
# erase slot 1
@ -93,5 +94,5 @@ def test_slot_erase():
"cache_prompt": True,
})
assert res.status_code == 200
assert match_regex("(Lily|cake)+", res.body["content"])
assert match_regex("(Whiskers|Flana)+", res.body["content"])
assert res.body["timings"]["prompt_n"] == 21 # all tokens are processed

View file

@ -47,7 +47,7 @@ class ServerProcess:
model_url: str | None = None
model_file: str | None = None
n_threads: int | None = None
n_gpu_layer: str | None = None
n_gpu_layer: int | None = None
n_batch: int | None = None
n_ubatch: int | None = None
n_ctx: int | None = None