@@ -50,7 +50,7 @@ function extremeTopK(testCase)
50
50
%% This should work, and it does on some computers. On others, Ollama
51
51
%% receives the parameter, but either Ollama or llama.cpp fails to
52
52
%% honor it correctly.
53
- testCase .assumeTrue(false ," disabled due to Ollama/llama.cpp not honoring parameter reliably" );
53
+ % testCase.assumeTrue(false,"disabled due to Ollama/llama.cpp not honoring parameter reliably");
54
54
55
55
% setting top-k to k=1 leaves no random choice,
56
56
% so we expect to get a fixed response.
@@ -61,11 +61,27 @@ function extremeTopK(testCase)
61
61
testCase .verifyEqual(response1 ,response2 );
62
62
end
63
63
64
+ function extremeMinP(testCase )
65
+ %% This should work, and it does on some computers. On others, Ollama
66
+ %% receives the parameter, but either Ollama or llama.cpp fails to
67
+ %% honor it correctly.
68
+ % testCase.assumeTrue(false,"disabled due to Ollama/llama.cpp not honoring parameter reliably");
69
+
70
+ % setting min-p to p=1 means only tokens with the same logit as
71
+ % the most likely one can be chosen, which will almost certainly
72
+ % only ever be one, so we expect to get a fixed response.
73
+ chat = ollamaChat(" mistral" ,MinP= 1 );
74
+ prompt = " Min-p sampling with p=1 returns a definite answer." ;
75
+ response1 = generate(chat ,prompt );
76
+ response2 = generate(chat ,prompt );
77
+ testCase .verifyEqual(response1 ,response2 );
78
+ end
79
+
64
80
function extremeTfsZ(testCase )
65
81
%% This should work, and it does on some computers. On others, Ollama
66
82
%% receives the parameter, but either Ollama or llama.cpp fails to
67
83
%% honor it correctly.
68
- testCase .assumeTrue(false ," disabled due to Ollama/llama.cpp not honoring parameter reliably" );
84
+ % testCase.assumeTrue(false,"disabled due to Ollama/llama.cpp not honoring parameter reliably");
69
85
70
86
% setting tfs_z to z=0 leaves no random choice, but degrades to
71
87
% greedy sampling, so we expect to get a fixed response.
@@ -235,6 +251,16 @@ function queryModels(testCase)
235
251
" Value" , - 20 , ...
236
252
" Error" , " MATLAB:expectedNonnegative" ), ...
237
253
...
254
+ " MinPTooLarge" , struct( ...
255
+ " Property" , " MinP" , ...
256
+ " Value" , 20 , ...
257
+ " Error" , " MATLAB:notLessEqual" ), ...
258
+ ...
259
+ " MinPTooSmall" , struct( ...
260
+ " Property" , " MinP" , ...
261
+ " Value" , - 20 , ...
262
+ " Error" , " MATLAB:expectedNonnegative" ), ...
263
+ ...
238
264
" WrongTypeStopSequences" , struct( ...
239
265
" Property" , " StopSequences" , ...
240
266
" Value" , 123 , ...
@@ -329,6 +355,14 @@ function queryModels(testCase)
329
355
" Input" ,{{ " TopP" - 20 }},...
330
356
" Error" ," MATLAB:expectedNonnegative" ),...I
331
357
...
358
+ " MinPTooLarge" ,struct( ...
359
+ " Input" ,{{ " MinP" 20 }},...
360
+ " Error" ," MATLAB:notLessEqual" ),...
361
+ ...
362
+ " MinPTooSmall" ,struct( ...
363
+ " Input" ,{{ " MinP" - 20 }},...
364
+ " Error" ," MATLAB:expectedNonnegative" ),...I
365
+ ...
332
366
" WrongTypeStopSequences" ,struct( ...
333
367
" Input" ,{{ " StopSequences" 123 }},...
334
368
" Error" ," MATLAB:validators:mustBeNonzeroLengthText" ),...
0 commit comments