@@ -25,7 +25,9 @@ def test_ctx_shift_enabled():
2525 # the prompt is truncated to keep the last 109 tokens
2626 # 64 tokens are generated thanks to shifting the context when it gets full
2727 global server
28+ server .enable_ctx_shift = True
2829 server .start ()
30+ server .enable_ctx_shift = False
2931 res = server .make_request ("POST" , "/completion" , data = {
3032 "n_predict" : 64 ,
3133 "prompt" : LONG_TEXT ,
@@ -42,7 +44,6 @@ def test_ctx_shift_enabled():
4244])
4345def test_ctx_shift_disabled_short_prompt (n_predict : int , n_token_output : int , truncated : bool ):
4446 global server
45- server .disable_ctx_shift = True
4647 server .n_predict = - 1
4748 server .start ()
4849 res = server .make_request ("POST" , "/completion" , data = {
@@ -56,7 +57,6 @@ def test_ctx_shift_disabled_short_prompt(n_predict: int, n_token_output: int, tr
5657
5758def test_ctx_shift_disabled_long_prompt ():
5859 global server
59- server .disable_ctx_shift = True
6060 server .start ()
6161 res = server .make_request ("POST" , "/completion" , data = {
6262 "n_predict" : 64 ,
@@ -68,7 +68,6 @@ def test_ctx_shift_disabled_long_prompt():
6868
6969def test_ctx_shift_disabled_stream ():
7070 global server
71- server .disable_ctx_shift = True
7271 server .start ()
7372 res = server .make_stream_request ("POST" , "/v1/completions" , data = {
7473 "n_predict" : 256 ,
0 commit comments