-
Notifications
You must be signed in to change notification settings - Fork 36
Fix function call #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ | |
|
||
arguments | ||
this (1,1) openAIImages | ||
prompt {mustBeTextScalar} | ||
prompt {mustBeNonzeroLengthTextScalar} | ||
nvp.NumImages (1,1) {mustBePositive, mustBeInteger,... | ||
mustBeLessThanOrEqual(nvp.NumImages,10)} = 1 | ||
nvp.Size (1,1) string {mustBeMember(nvp.Size, ["256x256", "512x512", ... | ||
|
@@ -176,7 +176,7 @@ | |
arguments | ||
this (1,1) openAIImages | ||
imagePath {mustBeValidFileType(imagePath)} | ||
prompt {mustBeTextScalar} | ||
prompt {mustBeNonzeroLengthTextScalar} | ||
nvp.MaskImagePath {mustBeValidFileType(nvp.MaskImagePath)} | ||
nvp.NumImages (1,1) {mustBePositive, mustBeInteger,... | ||
mustBeLessThanOrEqual(nvp.NumImages,10)} = 1 | ||
|
@@ -345,7 +345,9 @@ function validatePromptSize(model, prompt) | |
function mustBeValidFileType(filePath) | ||
mustBeFile(filePath); | ||
s = dir(filePath); | ||
if ~endsWith(s.name, ".png") | ||
imgDetails = imfinfo(filePath); | ||
imgFormat = imgDetails.Format; | ||
if ~(imgFormat=="png") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come do we accept only "png"? Is it a requirement from the OpenAI API? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that restriction comes from the OpenAI side. We might later want to add a test to make sure this behavior not changing. |
||
error("llms:pngExpected", ... | ||
llms.utils.errorMessageCatalog.getMessage("llms:pngExpected")); | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openAIImages is not perfectly aligned. Just delete a space before it.