@@ -61,6 +61,22 @@ function extremeTopK(testCase)
6161 testCase .verifyEqual(response1 ,response2 );
6262 end
6363
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+
6480 function extremeTfsZ(testCase )
6581 %% This should work, and it does on some computers. On others, Ollama
6682 %% receives the parameter, but either Ollama or llama.cpp fails to
@@ -235,6 +251,16 @@ function queryModels(testCase)
235251 " Value" , - 20 , ...
236252 " Error" , " MATLAB:expectedNonnegative" ), ...
237253 ...
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+ ...
238264 " WrongTypeStopSequences" , struct( ...
239265 " Property" , " StopSequences" , ...
240266 " Value" , 123 , ...
@@ -329,6 +355,14 @@ function queryModels(testCase)
329355 " Input" ,{{ " TopP" - 20 }},...
330356 " Error" ," MATLAB:expectedNonnegative" ),...I
331357 ...
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+ ...
332366 " WrongTypeStopSequences" ,struct( ...
333367 " Input" ,{{ " StopSequences" 123 }},...
334368 " Error" ," MATLAB:validators:mustBeNonzeroLengthText" ),...
0 commit comments