Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -65,7 +65,7 @@ public InferenceServer(
);
}

final HttpUrl url = authApplier.applyToUrl(withModelSelection(parsedUrl));
final HttpUrl url = authApplier.applyToUrl(parsedUrl);

final Request.Builder requestBuilder = new Request.Builder()
.url(url)
Expand Down Expand Up @@ -132,16 +132,6 @@ private void validate(
}
}

private @NotNull HttpUrl withModelSelection(final @NotNull HttpUrl url) {
if (endpoint.getModelFamily().isEmpty()) {
return url;
}
return url.newBuilder()
.setQueryParameter("model-family", endpoint.getModelFamily())
.setQueryParameter("model-name", endpoint.getModelName())
.build();
}

private static void warnIfBlank(
final @NotNull Logger logger,
final @NotNull String key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ public class InferenceEndpointSettings {

@NotNull String baseUrl;
@NotNull String path;
@NotNull String modelFamily;
@NotNull String modelName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,8 @@ public class InferenceSettingsFactory {
) {
final String baseUrl = endpointNode.node("base-url").getString("http://localhost:8080");
final String path = normalizePath(endpointNode.node("path").getString("/api/v1/inference/"));
final String modelFamily = endpointNode.node("model-family").getString("").trim();
final String modelName = endpointNode.node("model-name").getString("").trim();

if (modelFamily.isEmpty() != modelName.isEmpty()) {
throw new IllegalArgumentException(
"inference.endpoint.model-family and model-name must be set together"
);
}

return new InferenceEndpointSettings(baseUrl, path, modelFamily, modelName);
return new InferenceEndpointSettings(baseUrl, path);
}

private @NotNull InferenceRequestSettings parseRequest(
Expand Down
3 changes: 1 addition & 2 deletions common/src/main/resources/en/inference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ inference:
base-url: 'https://api.react-ac.space'

path: '/api/v2/inference/'
model-family: 'flower'
model-name: 'baseline'
# The server selects the model from the subscription token.

# Only required for custom models
request:
Expand Down
3 changes: 1 addition & 2 deletions common/src/main/resources/ru/inference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ inference:
base-url: 'https://api.react-ac.space'

path: '/api/v2/inference/'
model-family: 'flower'
model-name: 'baseline'
# The server selects the model from the subscription token.

# Нужно только для своих кастомных моделей
request:
Expand Down
Loading