Skip to content

Commit

Permalink
Optimize model test
Browse files Browse the repository at this point in the history
Signed-off-by: fanyinbo <[email protected]>
  • Loading branch information
fanyinbo committed Dec 26, 2023
1 parent 8035b00 commit 30decd4
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import java.util.List;

import static ai.basic.x1.util.Constants.FILE;

/**
* @author zhujh
*/
Expand All @@ -22,7 +24,13 @@ public static ImageDetectionReqDTO convert(ModelMessageBO message) {
if (CollUtil.isEmpty(fileNodes)) {
throw new IllegalArgumentException("file is not found");
}
String url = fileNodes.get(0).getFile().getInternalUrl();
var fileNodeBO = fileNodes.get(0);
String url;
if (fileNodeBO.getType().equals(FILE)) {
url = fileNodeBO.getFile().getInternalUrl();
} else {
url = fileNodeBO.getFiles().get(0).getFile().getInternalUrl();
}
if (StrUtil.isEmpty(url)) {
throw new IllegalArgumentException("file url is empty");
}
Expand Down

0 comments on commit 30decd4

Please sign in to comment.