-
Notifications
You must be signed in to change notification settings - Fork 138
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
getFirst is not allowed in java 17 #3226
Conversation
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
@@ -41,7 +42,7 @@ public RemoteInferenceInputDataSet process(MLInput mlInput) { | |||
* connector.pre_process.cohere.embedding | |||
* Cohere expects An array of image data URIs for the model to embed. Maximum number of images per call is 1. | |||
*/ | |||
parametersMap.put("images", inputData.getDocs().getFirst()); | |||
parametersMap.put("images", inputData.getDocs().get(0)); |
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.
can docs
here be empty or null?
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.
Seems already validate by L28?
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.
Seems already validate by L28?
Yup
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.
yeah, it is also handled in the constructor here:
@Builder(toBuilder = true)
public TextDocsInputDataSet(List<String> docs, ModelResultFilter resultFilter) {
super(MLInputDataType.TEXT_DOCS);
this.resultFilter = resultFilter;
Objects.requireNonNull(docs);
if (docs.size() == 0) {
throw new IllegalArgumentException("empty docs");
}
this.docs = docs;
}
Was |
Description
[getFirst is not allowed in java 17]
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.