Skip to content

Commit 2611327

Browse files
committed
Avoid bogus json
Entries like `top_k=Inf` become `"top_k": null` in `jsonencode`. While Ollama does not complain, those are not actually valid settings. Since the places where we accept `Inf` already have that as a default, take the easy way out and simply drop those parameters.
1 parent 7e81d37 commit 2611327

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

+llms/+internal/callOllamaChatAPI.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888

8989
nvpOptions = keys(dict);
9090
for opt = nvpOptions.'
91-
if isfield(nvp, opt)
91+
if isfield(nvp, opt) && ~isempty(nvp.(opt)) && ~isequaln(nvp.(opt),Inf)
9292
options.(dict(opt)) = nvp.(opt);
9393
end
9494
end

0 commit comments

Comments
 (0)