Skip to content

Commit

Permalink
server : fix test regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed May 20, 2024
1 parent 0ae2860 commit 7fb66eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions examples/server/tests/features/server.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Feature: llama.cpp server

Examples: Prompts
| prompt | n_predict | re_content | n_prompt | n_predicted | truncated |
| I believe the meaning of life is | 8 | (read\|going)+ | 18 | 8 | not |
| Write a joke about AI from a very long prompt which will not be truncated | 256 | (princesses\|everyone\|kids\|Anna\|forest)+ | 46 | 64 | not |
| I believe the meaning of life is | 8 | (read\|going\|pretty)+ | 18 | 8 | not |
| Write a joke about AI from a very long prompt which will not be truncated | 256 | (princesses\|everyone\|kids\|Anna\|forest)+ | 45 | 64 | not |

Scenario: Completion prompt truncated
Given a prompt:
Expand Down Expand Up @@ -67,8 +67,8 @@ Feature: llama.cpp server

Examples: Prompts
| model | system_prompt | user_prompt | max_tokens | re_content | n_prompt | n_predicted | enable_streaming | truncated |
| llama-2 | Book | What is the best book | 8 | (Here\|what)+ | 77 | 8 | disabled | not |
| codellama70b | You are a coding assistant. | Write the fibonacci function in c++. | 128 | (thanks\|happy\|bird\|Annabyear)+ | -1 | 64 | enabled | |
| llama-2 | Book | What is the best book | 8 | (Here\|what)+ | 76 | 8 | disabled | not |
| codellama70b | You are a coding assistant. | Write the fibonacci function in c++. | 128 | (thanks\|happy\|bird\|fireplace)+ | -1 | 64 | enabled | |


Scenario Outline: OAI Compatibility w/ response format
Expand All @@ -84,7 +84,7 @@ Feature: llama.cpp server
| response_format | n_predicted | re_content |
| {"type": "json_object", "schema": {"const": "42"}} | 5 | "42" |
| {"type": "json_object", "schema": {"items": [{"type": "integer"}]}} | 10 | \[ -300 \] |
| {"type": "json_object"} | 10 | \{ " Jacky. |
| {"type": "json_object"} | 10 | \{ " Saragine. |


Scenario: Tokenize / Detokenize
Expand Down
4 changes: 2 additions & 2 deletions examples/server/tests/features/slotsave.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: llama.cpp server slot management
# Since we have cache, this should only process the last tokens
Given a user prompt "What is the capital of Germany?"
And a completion request with no api error
Then 24 tokens are predicted matching (Thank|special)
Then 24 tokens are predicted matching (Thank|special|Lily)
And 7 prompt tokens are processed
# Loading the original cache into slot 0,
# we should only be processing 1 prompt token and get the same output
Expand All @@ -41,7 +41,7 @@ Feature: llama.cpp server slot management
Given a user prompt "What is the capital of Germany?"
And using slot id 1
And a completion request with no api error
Then 24 tokens are predicted matching (Thank|special)
Then 24 tokens are predicted matching (Thank|special|Lily)
And 1 prompt tokens are processed

Scenario: Erase Slot
Expand Down

0 comments on commit 7fb66eb

Please sign in to comment.