File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
examples/server/tests/unit Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,37 @@ def test_different_draft_min_draft_max():
8282 last_content = res .body ["content" ]
8383
8484
85+ def test_slot_ctx_not_exceeded ():
86+ global server
87+ server .n_ctx = 64
88+ server .start ()
89+ res = server .make_request ("POST" , "/completion" , data = {
90+ "prompt" : "Hello " * 56 ,
91+ "temperature" : 0.0 ,
92+ "top_k" : 1 ,
93+ "speculative.p_min" : 0.0 ,
94+ })
95+ assert res .status_code == 200
96+ assert len (res .body ["content" ]) > 0
97+
98+
99+ def test_with_ctx_shift ():
100+ global server
101+ server .n_ctx = 64
102+ server .start ()
103+ res = server .make_request ("POST" , "/completion" , data = {
104+ "prompt" : "Hello " * 56 ,
105+ "temperature" : 0.0 ,
106+ "top_k" : 1 ,
107+ "n_predict" : 64 ,
108+ "speculative.p_min" : 0.0 ,
109+ })
110+ assert res .status_code == 200
111+ assert len (res .body ["content" ]) > 0
112+ assert res .body ["tokens_predicted" ] == 64
113+ assert res .body ["truncated" ] == True
114+
115+
85116@pytest .mark .parametrize ("n_slots,n_requests" , [
86117 (1 , 2 ),
87118 (2 , 2 ),
You can’t perform that action at this time.
0 commit comments