Skip to content

Commit 590c979

Browse files
author
ochafik
committed
Update tests readme + add raw output to verbose log
1 parent 774557c commit 590c979

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

examples/server/server.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,6 +2302,7 @@ struct server_context {
23022302
res->oaicompat_model = slot.params.oaicompat_model;
23032303
res->oaicompat_cmpl_id = slot.params.oaicompat_cmpl_id;
23042304
if (slot.params.chat_parser) {
2305+
LOG_DBG("Raw chat output: %s\n", slot.generated_text.c_str());
23052306
res->message = slot.params.chat_parser(slot.generated_text);
23062307
} else {
23072308
res->message = {

examples/server/tests/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ It's possible to override some scenario steps values with environment variables:
3131
| `LLAMA_SERVER_BIN_PATH` | to change the server binary path, default: `../../../build/bin/llama-server` |
3232
| `DEBUG` | to enable steps and server verbose mode `--verbose` |
3333
| `N_GPU_LAYERS` | number of model layers to offload to VRAM `-ngl --n-gpu-layers` |
34+
| `LLAMA_CACHE` | by default server tests re-download models to the `tmp` subfolder. Set this to your cache (e.g. `$HOME/Library/Caches/llama.cpp` on Mac or `$HOME/.cache/llama.cpp` on Unix) to avoid this |
3435

35-
To run slow tests:
36+
To run slow tests (will download many models, make sure to set `LLAMA_CACHE` if needed):
3637

3738
```shell
3839
SLOW_TESTS=1 ./tests.sh
@@ -44,10 +45,16 @@ To run with stdout/stderr display in real time (verbose output, but useful for d
4445
DEBUG=1 ./tests.sh -s -v -x
4546
```
4647

47-
To run single test unit:
48+
To run all the tests in a file:
4849

4950
```shell
50-
./tests.sh unit/test_{name of test case here}.py -v -x
51+
./tests.sh unit/test_chat_completion.py.py -v -x
52+
```
53+
54+
To run a single test:
55+
56+
```shell
57+
./tests.sh unit/test_chat_completion.py::test_invalid_chat_completion_req
5158
```
5259

5360
Hint: You can compile and run test in single command, useful for local developement:

0 commit comments

Comments
 (0)