Skip to content

Commit ed98852

Browse files
committed
test: tighten Qwen 3.5 completion prompts
1 parent 5e9064e commit ed98852

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎tests/test_llama.py‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ def test_real_llama(llama_cpp_model_path):
136136
)
137137

138138
output = model.create_completion(
139-
"The quick brown fox jumps over the lazy dog. The quick brown fox jumps ",
140-
max_tokens=4,
139+
"The quick brown fox jumps over the lazy dog. The quick brown fox",
140+
max_tokens=6,
141141
top_k=50,
142142
top_p=0.9,
143-
temperature=0.8,
143+
temperature=0.0,
144144
seed=1337,
145145
)
146-
assert output["choices"][0]["text"] == "5 times over the"
146+
assert output["choices"][0]["text"] == " jumps over the lazy dog."
147147

148148
output = model.create_completion(
149149
"The capital of france is paris, 'true' or 'false'?:\n",
@@ -184,23 +184,23 @@ def logit_processor_func(input_ids, logits):
184184
state = model.save_state()
185185

186186
output = model.create_completion(
187-
"Pick a random number from 1 to 10:\n",
187+
"Pick a number from 1 to 10?:\n",
188188
max_tokens=4,
189189
top_k=50,
190190
top_p=0.9,
191-
temperature=0.8,
191+
temperature=1.0,
192192
grammar=llama_cpp.LlamaGrammar.from_string("""
193193
root ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10"
194194
"""),
195195
)
196196
number_1 = output["choices"][0]["text"]
197197

198198
output = model.create_completion(
199-
"Pick a random number from 1 to 10:\n",
199+
"Pick a number from 1 to 10?:\n",
200200
max_tokens=4,
201201
top_k=50,
202202
top_p=0.9,
203-
temperature=0.8,
203+
temperature=1.0,
204204
grammar=llama_cpp.LlamaGrammar.from_string("""
205205
root ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10"
206206
"""),
@@ -210,11 +210,11 @@ def logit_processor_func(input_ids, logits):
210210
model.load_state(state)
211211

212212
output = model.create_completion(
213-
"Pick a random number from 1 to 10:\n",
213+
"Pick a number from 1 to 10?:\n",
214214
max_tokens=4,
215215
top_k=50,
216216
top_p=0.9,
217-
temperature=0.8,
217+
temperature=1.0,
218218
grammar=llama_cpp.LlamaGrammar.from_string("""
219219
root ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10"
220220
"""),

0 commit comments

Comments
 (0)