Skip to content

Commit

Permalink
feat: ML model feature test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mangern committed Sep 27, 2024
1 parent 8554071 commit 82a6928
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ public void updateFileContent(String content) {
this.CST = parsingResult.CST().get();
lexer.setCST(CST);

logger.info("======== CST for file: " + fileURI + " ========");
//logger.info("======== CST for file: " + fileURI + " ========");

CSTUtils.printTree(logger, CST);
//CSTUtils.printTree(logger, CST);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ Stream<DynamicTest> generateBadFileTests() {
new BadFileTestCase("../../../config-model/src/test/examples/simple.sd", 5), // TODO: unused rank-profile functions should throw errors? Also rank-type doesntexist: ... in field?

new BadFileTestCase("src/test/sdfiles/single/rankprofilefuncs.sd", 2),
new BadFileTestCase("src/test/sdfiles/single/onnxmodel.sd", 1),
};

return Arrays.stream(tests)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
schema onnxmodel {
document onnxmodel {
}

rank-profile profile {
first-phase {
expression: sum( onnxModel(mymodel).output_name )
}

second-phase {
expression: sum( onnx(noexist).nooutput ) # should give error
}

onnx-model mymodel {
file: files/something.onnx
}

function func_a() {
expression: sum(xgboost("xgboost.json"))
}

function func_b() {
expression: sum(lightbgm("/path/to/lightbgm-model.json"))
}
}
}

0 comments on commit 82a6928

Please sign in to comment.