Skip to content

Commit a360f89

Browse files
committed
Ollama does not support NumCompletions
1 parent 09b8662 commit a360f89

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

+llms/+internal/callOllamaChatAPI.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
nvp.TopP
3232
nvp.TopK
3333
nvp.TailFreeSamplingZ
34-
nvp.NumCompletions
3534
nvp.StopSequences
3635
nvp.MaxNumTokens
3736
nvp.ResponseFormat
@@ -102,7 +101,6 @@
102101
dict("TopP") = "top_p";
103102
dict("TopK") = "top_k";
104103
dict("TailFreeSamplingZ") = "tfs_z";
105-
dict("NumCompletions") = "n";
106104
dict("StopSequences") = "stop";
107105
dict("MaxNumTokens") = "num_predict";
108106
end

ollamaChat.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,15 @@
121121
% [TEXT, MESSAGE, RESPONSE] = generate(__, Name=Value) specifies additional options
122122
% using one or more name-value arguments:
123123
%
124-
% NumCompletions - Number of completions to generate.
125-
% Default value is 1.
126-
%
127124
% MaxNumTokens - Maximum number of tokens in the generated response.
128125
% Default value is inf.
129126
%
130-
% ToolChoice - Function to execute. 'none', 'auto',
131-
% or specify the function to call.
132-
%
133127
% Seed - An integer value to use to obtain
134128
% reproducible responses
135129

136130
arguments
137131
this (1,1) ollamaChat
138132
messages {mustBeValidMsgs}
139-
nvp.NumCompletions (1,1) {mustBePositive, mustBeInteger} = 1
140133
nvp.MaxNumTokens (1,1) {mustBePositive} = inf
141134
nvp.Seed {mustBeIntegerOrEmpty(nvp.Seed)} = []
142135
end
@@ -157,7 +150,6 @@
157150
Temperature=this.Temperature, ...
158151
TopP=this.TopP, TopK=this.TopK,...
159152
TailFreeSamplingZ=this.TailFreeSamplingZ,...
160-
NumCompletions=nvp.NumCompletions,...
161153
StopSequences=this.StopSequences, MaxNumTokens=nvp.MaxNumTokens, ...
162154
ResponseFormat=this.ResponseFormat,Seed=nvp.Seed, ...
163155
TimeOut=this.TimeOut, StreamFun=this.StreamFun);

tests/tollamaChat.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,5 @@ function queryModels(testCase)
307307
...
308308
"InvalidMaxNumTokensValue",struct( ...
309309
"Input",{{ validMessages "MaxNumTokens" 0 }},...
310-
"Error","MATLAB:validators:mustBePositive"),...
311-
...
312-
"InvalidNumCompletionsType",struct( ...
313-
"Input",{{ validMessages "NumCompletions" "2" }},...
314-
"Error","MATLAB:validators:mustBeNumericOrLogical"),...
315-
...
316-
"InvalidNumCompletionsValue",struct( ...
317-
"Input",{{ validMessages "NumCompletions" 0 }},...
318310
"Error","MATLAB:validators:mustBePositive"));
319311
end

0 commit comments

Comments
 (0)