Skip to content
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

Fix remote model with embedding input issue #3289

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ public class ModelInterfaceUtils {
+ " \"texts\"\n"
+ " ]\n"
+ " }\n"
+ " },\n"
+ " \"required\": [\n"
+ " \"parameters\"\n"
+ " ]\n"
+ " }\n"
+ "}";

private static final String TITAN_TEXT_EMBEDDING_MODEL_INTERFACE_INPUT = "{\n"
Expand All @@ -72,10 +69,7 @@ public class ModelInterfaceUtils {
+ " \"inputText\"\n"
+ " ]\n"
+ " }\n"
+ " },\n"
+ " \"required\": [\n"
+ " \"parameters\"\n"
+ " ]\n"
+ " }\n"
+ "}";

private static final String TITAN_MULTI_MODAL_EMBEDDING_MODEL_INTERFACE_INPUT = "{\n"
Expand All @@ -92,10 +86,7 @@ public class ModelInterfaceUtils {
+ " }\n"
+ " }\n"
+ " }\n"
+ " },\n"
+ " \"required\": [\n"
+ " \"parameters\"\n"
+ " ]\n"
+ " }\n"
+ "}";

private static final String AMAZON_COMPREHEND_DETECTDOMAINANTLANGUAGE_API_INTERFACE_INPUT = "{\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,31 @@ public void testValidateSchema() throws IOException {
MLNodeUtils.validateSchema(schema, json);
}

@Test
public void testValidateEmbeddingInputWithRemoteSchema() throws IOException {
String schema = "{\n"
b4sjoo marked this conversation as resolved.
Show resolved Hide resolved
+ " \"type\": \"object\",\n"
+ " \"properties\": {\n"
+ " \"parameters\": {\n"
+ " \"type\": \"object\",\n"
+ " \"properties\": {\n"
+ " \"texts\": {\n"
+ " \"type\": \"array\",\n"
+ " \"items\": {\n"
+ " \"type\": \"string\"\n"
+ " }\n"
+ " }\n"
+ " },\n"
+ " \"required\": [\n"
+ " \"texts\"\n"
+ " ]\n"
+ " }\n"
+ " }\n"
+ "}";
String json = "{\"text_docs\":[ \"today is sunny\", \"today is sunny\"]}";
MLNodeUtils.validateSchema(schema, json);
}

@Test
public void testProcessRemoteInferenceInputDataSetParametersValueNoParameters() throws IOException {
String json = "{\"key1\":\"foo\",\"key2\":123,\"key3\":true}";
Expand Down
Loading