Skip to content

Commit bd20b8f

Browse files
committed
Merge branch 'main' into test-doubles
2 parents 9757ef7 + 062538c commit bd20b8f

File tree

6 files changed

+37
-11
lines changed

6 files changed

+37
-11
lines changed

+llms/+internal/textGenerator.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,10 @@
2828
properties (Access=protected)
2929
StreamFun
3030
end
31+
32+
methods
33+
function hObj = set.StopSequences(hObj,value)
34+
hObj.StopSequences = string(value);
35+
end
36+
end
3137
end

+llms/+utils/mustBeValidStop.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ function mustBeValidStop(value)
55
if ~isempty(value)
66
mustBeVector(value);
77
mustBeNonzeroLengthText(value);
8+
value = string(value);
89
% This restriction is set by the OpenAI API
910
if numel(value)>4
1011
error("llms:stopSequencesMustHaveMax4Elements", llms.utils.errorMessageCatalog.getMessage("llms:stopSequencesMustHaveMax4Elements"));

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Code owners, to get auto-filled reviewer lists
2+
3+
# To start with, we just assume everyone in the core team is included on all reviews
4+
* @adulai @ccreutzi @debymf @MiriamScharnke @vpapanasta

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Pull models
3131
run: |
3232
ollama pull mistral
33-
ollama pull bakllava
33+
ollama pull moondream
3434
OLLAMA_HOST=127.0.0.1:11435 ollama pull qwen2:0.5b
3535
- name: Set up MATLAB
3636
uses: matlab-actions/setup-matlab@v2

tests/tollamaChat.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function seedFixesResult(testCase)
9999
end
100100

101101
function generateWithImages(testCase)
102-
chat = ollamaChat("bakllava");
102+
chat = ollamaChat("moondream");
103103
image_path = "peppers.png";
104104
emptyMessages = messageHistory;
105105
messages = addUserMessageWithImages(emptyMessages,"What is in the image?",image_path);

tests/topenAIChat.m

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,14 @@ function keyNotFound(testCase)
388388
function validConstructorInput = iGetValidConstructorInput()
389389
% while it is valid to provide the key via an environment variable,
390390
% this test set does not use that, for easier setup
391-
validFunction = openAIFunction("funName");
392391
validConstructorInput = struct( ...
393392
"JustKey", struct( ...
394393
"Input",{{"APIKey","this-is-not-a-real-key"}}, ...
395394
"ExpectedWarning", '', ...
396395
"VerifyProperties", struct( ...
397396
"Temperature", {1}, ...
398397
"TopP", {1}, ...
399-
"StopSequences", {{}}, ...
398+
"StopSequences", {string([])}, ...
400399
"PresencePenalty", {0}, ...
401400
"FrequencyPenalty", {0}, ...
402401
"TimeOut", {10}, ...
@@ -412,7 +411,7 @@ function keyNotFound(testCase)
412411
"VerifyProperties", struct( ...
413412
"Temperature", {1}, ...
414413
"TopP", {1}, ...
415-
"StopSequences", {{}}, ...
414+
"StopSequences", {string([])}, ...
416415
"PresencePenalty", {0}, ...
417416
"FrequencyPenalty", {0}, ...
418417
"TimeOut", {10}, ...
@@ -428,7 +427,7 @@ function keyNotFound(testCase)
428427
"VerifyProperties", struct( ...
429428
"Temperature", {2}, ...
430429
"TopP", {1}, ...
431-
"StopSequences", {{}}, ...
430+
"StopSequences", {string([])}, ...
432431
"PresencePenalty", {0}, ...
433432
"FrequencyPenalty", {0}, ...
434433
"TimeOut", {10}, ...
@@ -444,7 +443,7 @@ function keyNotFound(testCase)
444443
"VerifyProperties", struct( ...
445444
"Temperature", {1}, ...
446445
"TopP", {0.2}, ...
447-
"StopSequences", {{}}, ...
446+
"StopSequences", {string([])}, ...
448447
"PresencePenalty", {0}, ...
449448
"FrequencyPenalty", {0}, ...
450449
"TimeOut", {10}, ...
@@ -470,13 +469,29 @@ function keyNotFound(testCase)
470469
"ResponseFormat", {"text"} ...
471470
) ...
472471
), ...
472+
"StopSequencesCharVector", struct( ...
473+
"Input",{{"APIKey","this-is-not-a-real-key","StopSequences",'supercalifragilistic'}}, ...
474+
"ExpectedWarning", '', ...
475+
"VerifyProperties", struct( ...
476+
"Temperature", {1}, ...
477+
"TopP", {1}, ...
478+
"StopSequences", {"supercalifragilistic"}, ...
479+
"PresencePenalty", {0}, ...
480+
"FrequencyPenalty", {0}, ...
481+
"TimeOut", {10}, ...
482+
"FunctionNames", {[]}, ...
483+
"ModelName", {"gpt-4o-mini"}, ...
484+
"SystemPrompt", {[]}, ...
485+
"ResponseFormat", {"text"} ...
486+
) ...
487+
), ...
473488
"PresencePenalty", struct( ...
474489
"Input",{{"APIKey","this-is-not-a-real-key","PresencePenalty",0.1}}, ...
475490
"ExpectedWarning", '', ...
476491
"VerifyProperties", struct( ...
477492
"Temperature", {1}, ...
478493
"TopP", {1}, ...
479-
"StopSequences", {{}}, ...
494+
"StopSequences", {string([])}, ...
480495
"PresencePenalty", {0.1}, ...
481496
"FrequencyPenalty", {0}, ...
482497
"TimeOut", {10}, ...
@@ -492,7 +507,7 @@ function keyNotFound(testCase)
492507
"VerifyProperties", struct( ...
493508
"Temperature", {1}, ...
494509
"TopP", {1}, ...
495-
"StopSequences", {{}}, ...
510+
"StopSequences", {string([])}, ...
496511
"PresencePenalty", {0}, ...
497512
"FrequencyPenalty", {0.1}, ...
498513
"TimeOut", {10}, ...
@@ -508,7 +523,7 @@ function keyNotFound(testCase)
508523
"VerifyProperties", struct( ...
509524
"Temperature", {1}, ...
510525
"TopP", {1}, ...
511-
"StopSequences", {{}}, ...
526+
"StopSequences", {string([])}, ...
512527
"PresencePenalty", {0}, ...
513528
"FrequencyPenalty", {0}, ...
514529
"TimeOut", {0.1}, ...
@@ -524,7 +539,7 @@ function keyNotFound(testCase)
524539
"VerifyProperties", struct( ...
525540
"Temperature", {1}, ...
526541
"TopP", {1}, ...
527-
"StopSequences", {{}}, ...
542+
"StopSequences", {string([])}, ...
528543
"PresencePenalty", {0}, ...
529544
"FrequencyPenalty", {0}, ...
530545
"TimeOut", {10}, ...

0 commit comments

Comments
 (0)