Skip to content

Commit

Permalink
Fixing tests after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Feb 21, 2024
1 parent bac3502 commit 2e46037
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ private static InferenceService createInferenceService(Model model) {
for (int i = 0; i < texts.size(); i++) {
inferenceResults.add(createInferenceResults());
}
doReturn(inferenceResults).when(inferenceServiceResults).transformToLegacyFormat();
doReturn(inferenceResults).when(inferenceServiceResults).transformToCoordinationFormat();

listener.onResponse(inferenceServiceResults);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public TestServiceModel(
super(new ModelConfigurations(modelId, taskType, service, serviceSettings, taskSettings), new ModelSecrets(secretSettings));
}

@Override
public TestDenseInferenceServiceExtension.TestServiceSettings getServiceSettings() {
return (TestDenseInferenceServiceExtension.TestServiceSettings) super.getServiceSettings();
}

@Override
public TestTaskSettings getTaskSettings() {
return (TestTaskSettings) super.getTaskSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private SparseEmbeddingResults makeResults(List<String> input) {
for (int i = 0; i < input.size(); i++) {
var tokens = new ArrayList<SparseEmbeddingResults.WeightedToken>();
for (int j = 0; j < 5; j++) {
tokens.add(new SparseEmbeddingResults.WeightedToken(Integer.toString(j), (float) j));
tokens.add(new SparseEmbeddingResults.WeightedToken("feature_" + j, j + 1.0F));
}
embeddings.add(new SparseEmbeddingResults.Embedding(tokens, false));
}
Expand All @@ -127,7 +127,7 @@ private List<ChunkedInferenceServiceResults> makeChunkedResults(List<String> inp
for (int i = 0; i < input.size(); i++) {
var tokens = new ArrayList<TextExpansionResults.WeightedToken>();
for (int j = 0; j < 5; j++) {
tokens.add(new TextExpansionResults.WeightedToken(Integer.toString(j), (float) j));
tokens.add(new TextExpansionResults.WeightedToken("feature_" + j, j + 1.0F));
}
chunks.add(new ChunkedTextExpansionResults.ChunkedResult(input.get(i), tokens));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class InferenceRestIT extends ESClientYamlSuiteTestCase {
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.setting("xpack.security.enabled", "false")
.setting("xpack.security.http.ssl.enabled", "false")
.plugin("org.elasticsearch.xpack.inference.mock.TestInferenceServicePlugin")
.plugin("inference-service-test")
.distribution(DistributionType.DEFAULT)
.build();

Expand Down

0 comments on commit 2e46037

Please sign in to comment.