@aws-sdk/client-sagemakertrainingsessionruntime 0.0.0-stage → 3.1151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +222 -2
- package/dist-cjs/index.js +913 -0
- package/dist-es/SageMakerTrainingSessionRuntime.js +19 -0
- package/dist-es/SageMakerTrainingSessionRuntimeClient.js +47 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +40 -0
- package/dist-es/commandBuilder.js +6 -0
- package/dist-es/commands/ExecuteSamplingOperationCommand.js +4 -0
- package/dist-es/commands/ExecuteTrainingOperationCommand.js +4 -0
- package/dist-es/commands/GetSamplingOperationResultCommand.js +4 -0
- package/dist-es/commands/GetTrainingOperationResultCommand.js +4 -0
- package/dist-es/commands/SampleTrainingSessionCommand.js +4 -0
- package/dist-es/commands/SampleTrainingSessionWithResponseStreamCommand.js +4 -0
- package/dist-es/commands/index.js +6 -0
- package/dist-es/endpoint/EndpointParameters.js +11 -0
- package/dist-es/endpoint/bdd.js +29 -0
- package/dist-es/endpoint/endpointResolver.js +14 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +9 -0
- package/dist-es/models/SageMakerTrainingSessionRuntimeServiceException.js +9 -0
- package/dist-es/models/enums.js +20 -0
- package/dist-es/models/errors.js +66 -0
- package/dist-es/models/models_0.js +1 -0
- package/dist-es/runtimeConfig.browser.js +29 -0
- package/dist-es/runtimeConfig.js +43 -0
- package/dist-es/runtimeConfig.native.js +9 -0
- package/dist-es/runtimeConfig.shared.js +41 -0
- package/dist-es/runtimeExtensions.js +9 -0
- package/dist-es/schemas/schemas_0.js +454 -0
- package/dist-types/SageMakerTrainingSessionRuntime.d.ts +58 -0
- package/dist-types/SageMakerTrainingSessionRuntimeClient.d.ts +197 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/commandBuilder.d.ts +18 -0
- package/dist-types/commands/ExecuteSamplingOperationCommand.d.ts +169 -0
- package/dist-types/commands/ExecuteTrainingOperationCommand.d.ts +206 -0
- package/dist-types/commands/GetSamplingOperationResultCommand.d.ts +159 -0
- package/dist-types/commands/GetTrainingOperationResultCommand.d.ts +169 -0
- package/dist-types/commands/SampleTrainingSessionCommand.d.ts +123 -0
- package/dist-types/commands/SampleTrainingSessionWithResponseStreamCommand.d.ts +124 -0
- package/dist-types/commands/index.d.ts +6 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +44 -0
- package/dist-types/endpoint/bdd.d.ts +2 -0
- package/dist-types/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +17 -0
- package/dist-types/models/SageMakerTrainingSessionRuntimeServiceException.d.ts +15 -0
- package/dist-types/models/enums.d.ts +52 -0
- package/dist-types/models/errors.d.ts +67 -0
- package/dist-types/models/models_0.d.ts +1069 -0
- package/dist-types/runtimeConfig.browser.d.ts +58 -0
- package/dist-types/runtimeConfig.d.ts +58 -0
- package/dist-types/runtimeConfig.native.d.ts +57 -0
- package/dist-types/runtimeConfig.shared.d.ts +29 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/schemas/schemas_0.d.ts +64 -0
- package/dist-types/ts3.4/SageMakerTrainingSessionRuntime.d.ts +115 -0
- package/dist-types/ts3.4/SageMakerTrainingSessionRuntimeClient.d.ts +143 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +27 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +43 -0
- package/dist-types/ts3.4/commandBuilder.d.ts +40 -0
- package/dist-types/ts3.4/commands/ExecuteSamplingOperationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ExecuteTrainingOperationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetSamplingOperationResultCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/GetTrainingOperationResultCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/SampleTrainingSessionCommand.d.ts +52 -0
- package/dist-types/ts3.4/commands/SampleTrainingSessionWithResponseStreamCommand.d.ts +59 -0
- package/dist-types/ts3.4/commands/index.d.ts +6 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +45 -0
- package/dist-types/ts3.4/endpoint/bdd.d.ts +2 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +10 -0
- package/dist-types/ts3.4/index.d.ts +12 -0
- package/dist-types/ts3.4/models/SageMakerTrainingSessionRuntimeServiceException.d.ts +10 -0
- package/dist-types/ts3.4/models/enums.d.ts +24 -0
- package/dist-types/ts3.4/models/errors.d.ts +32 -0
- package/dist-types/ts3.4/models/models_0.d.ts +417 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +94 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +96 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +98 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +32 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/schemas/schemas_0.d.ts +64 -0
- package/package.json +67 -4
|
@@ -0,0 +1,913 @@
|
|
|
1
|
+
const { awsEndpointFunctions, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$1, createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client");
|
|
2
|
+
const { getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin } = require("@smithy/core");
|
|
3
|
+
const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, makeBuilder, createAggregatedClient } = require("@smithy/core/client");
|
|
4
|
+
const { Command: $Command } = require("@smithy/core/client");
|
|
5
|
+
exports.$Command = $Command;
|
|
6
|
+
exports.__Client = Client;
|
|
7
|
+
const { resolveDefaultsModeConfig, loadConfig, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig } = require("@smithy/core/config");
|
|
8
|
+
const { BinaryDecisionDiagram, EndpointCache, decideEndpoint, customEndpointFunctions, resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
|
|
9
|
+
const { parseUrl, getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
|
|
10
|
+
const { DEFAULT_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
|
|
11
|
+
const { TypeRegistry, getSchemaSerdePlugin } = require("@smithy/core/schema");
|
|
12
|
+
const { resolveAwsSdkSigV4Config, AwsSdkSigV4Signer, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
|
|
13
|
+
const { defaultProvider } = require("@aws-sdk/credential-provider-node");
|
|
14
|
+
const { toUtf8, fromUtf8, sdkStreamMixin, toBase64, fromBase64, calculateBodyLength } = require("@smithy/core/serde");
|
|
15
|
+
const { streamCollector, NodeHttpHandler } = require("@smithy/node-http-handler");
|
|
16
|
+
const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
|
|
17
|
+
const { Sha256 } = require("@smithy/core/checksum");
|
|
18
|
+
|
|
19
|
+
const defaultSageMakerTrainingSessionRuntimeHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
20
|
+
return {
|
|
21
|
+
operation: getSmithyContext(context).operation,
|
|
22
|
+
region: await normalizeProvider(config.region)() || (() => {
|
|
23
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
24
|
+
})(),
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
28
|
+
return {
|
|
29
|
+
schemeId: "aws.auth#sigv4",
|
|
30
|
+
signingProperties: {
|
|
31
|
+
name: "sagemaker",
|
|
32
|
+
region: authParameters.region,
|
|
33
|
+
},
|
|
34
|
+
propertiesExtractor: (config, context) => ({
|
|
35
|
+
signingProperties: {
|
|
36
|
+
config,
|
|
37
|
+
context,
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const defaultSageMakerTrainingSessionRuntimeHttpAuthSchemeProvider = (authParameters) => {
|
|
43
|
+
const options = [];
|
|
44
|
+
switch (authParameters.operation) {
|
|
45
|
+
default: {
|
|
46
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return options;
|
|
50
|
+
};
|
|
51
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
52
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
53
|
+
return Object.assign(config_0, {
|
|
54
|
+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const resolveClientEndpointParameters = (options) => {
|
|
59
|
+
return Object.assign(options, {
|
|
60
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
61
|
+
defaultSigningName: "sagemaker",
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const commonParams = {
|
|
65
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
66
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
67
|
+
Region: { type: "builtInParams", name: "region" },
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var version = "3.1150.0";
|
|
71
|
+
var packageInfo = {
|
|
72
|
+
version: version};
|
|
73
|
+
|
|
74
|
+
const a = "isSet", b = { "ref": "Endpoint" }, c = [{ "ref": "Region" }];
|
|
75
|
+
const _data = {
|
|
76
|
+
conditions: [
|
|
77
|
+
[a, [b]],
|
|
78
|
+
[a, c],
|
|
79
|
+
["aws.partition", c, "PartitionResult"],
|
|
80
|
+
["booleanEquals", [{ ref: "UseFIPS" }, true]]
|
|
81
|
+
],
|
|
82
|
+
results: [
|
|
83
|
+
[-1],
|
|
84
|
+
[-1, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
85
|
+
[b, {}],
|
|
86
|
+
["https://training-session-runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", {}],
|
|
87
|
+
["https://training-session-runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", {}],
|
|
88
|
+
[-1, "Invalid Configuration: Missing Region"]
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
const root = 2;
|
|
92
|
+
const r = 100_000_000;
|
|
93
|
+
const nodes = new Int32Array([
|
|
94
|
+
-1, 1, -1,
|
|
95
|
+
0, 6, 3,
|
|
96
|
+
1, 4, r + 5,
|
|
97
|
+
2, 5, r + 5,
|
|
98
|
+
3, r + 4, r + 3,
|
|
99
|
+
3, r + 1, r + 2,
|
|
100
|
+
]);
|
|
101
|
+
const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
102
|
+
|
|
103
|
+
const cache = new EndpointCache({
|
|
104
|
+
size: 50,
|
|
105
|
+
params: ["Endpoint", "Region", "UseFIPS"],
|
|
106
|
+
});
|
|
107
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
108
|
+
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
109
|
+
endpointParams: endpointParams,
|
|
110
|
+
logger: context.logger,
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
114
|
+
|
|
115
|
+
class SageMakerTrainingSessionRuntimeServiceException extends ServiceException {
|
|
116
|
+
static shapeId = "smithy.ts.sdk.synthetic.com.amazonaws.sagemakertrainingsessionruntime#SageMakerTrainingSessionRuntimeServiceException";
|
|
117
|
+
constructor(options) {
|
|
118
|
+
super(options);
|
|
119
|
+
Object.setPrototypeOf(this, SageMakerTrainingSessionRuntimeServiceException.prototype);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
class ConflictException extends SageMakerTrainingSessionRuntimeServiceException {
|
|
124
|
+
static shapeId = "com.amazonaws.sagemakertrainingsessionruntime#ConflictException";
|
|
125
|
+
name = "ConflictException";
|
|
126
|
+
$fault = "client";
|
|
127
|
+
constructor(opts) {
|
|
128
|
+
super({
|
|
129
|
+
name: "ConflictException",
|
|
130
|
+
$fault: "client",
|
|
131
|
+
...opts,
|
|
132
|
+
});
|
|
133
|
+
Object.setPrototypeOf(this, ConflictException.prototype);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
class InternalServerException extends SageMakerTrainingSessionRuntimeServiceException {
|
|
137
|
+
static shapeId = "com.amazonaws.sagemakertrainingsessionruntime#InternalServerException";
|
|
138
|
+
name = "InternalServerException";
|
|
139
|
+
$fault = "server";
|
|
140
|
+
constructor(opts) {
|
|
141
|
+
super({
|
|
142
|
+
name: "InternalServerException",
|
|
143
|
+
$fault: "server",
|
|
144
|
+
...opts,
|
|
145
|
+
});
|
|
146
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
class ResourceNotFoundException extends SageMakerTrainingSessionRuntimeServiceException {
|
|
150
|
+
static shapeId = "com.amazonaws.sagemakertrainingsessionruntime#ResourceNotFoundException";
|
|
151
|
+
name = "ResourceNotFoundException";
|
|
152
|
+
$fault = "client";
|
|
153
|
+
constructor(opts) {
|
|
154
|
+
super({
|
|
155
|
+
name: "ResourceNotFoundException",
|
|
156
|
+
$fault: "client",
|
|
157
|
+
...opts,
|
|
158
|
+
});
|
|
159
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
class ThrottlingException extends SageMakerTrainingSessionRuntimeServiceException {
|
|
163
|
+
static shapeId = "com.amazonaws.sagemakertrainingsessionruntime#ThrottlingException";
|
|
164
|
+
name = "ThrottlingException";
|
|
165
|
+
$fault = "client";
|
|
166
|
+
constructor(opts) {
|
|
167
|
+
super({
|
|
168
|
+
name: "ThrottlingException",
|
|
169
|
+
$fault: "client",
|
|
170
|
+
...opts,
|
|
171
|
+
});
|
|
172
|
+
Object.setPrototypeOf(this, ThrottlingException.prototype);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
class ValidationException extends SageMakerTrainingSessionRuntimeServiceException {
|
|
176
|
+
static shapeId = "com.amazonaws.sagemakertrainingsessionruntime#ValidationException";
|
|
177
|
+
name = "ValidationException";
|
|
178
|
+
$fault = "client";
|
|
179
|
+
constructor(opts) {
|
|
180
|
+
super({
|
|
181
|
+
name: "ValidationException",
|
|
182
|
+
$fault: "client",
|
|
183
|
+
...opts,
|
|
184
|
+
});
|
|
185
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const _A = "Accept";
|
|
190
|
+
const _APC = "AdamParamsConfig";
|
|
191
|
+
const _CE = "ConflictException";
|
|
192
|
+
const _CLC = "ComputeLogprobsConfig";
|
|
193
|
+
const _CLR = "ComputeLogprobsResult";
|
|
194
|
+
const _CT = "Content-Type";
|
|
195
|
+
const _D = "Datum";
|
|
196
|
+
const _DL = "DatumList";
|
|
197
|
+
const _ESO = "ExecuteSamplingOperation";
|
|
198
|
+
const _ESOI = "ExecuteSamplingOperationInput";
|
|
199
|
+
const _ESOO = "ExecuteSamplingOperationOutput";
|
|
200
|
+
const _ETC = "EncodedTextChunk";
|
|
201
|
+
const _ETCL = "EncodedTextChunkList";
|
|
202
|
+
const _ETO = "ExecuteTrainingOperation";
|
|
203
|
+
const _ETOI = "ExecuteTrainingOperationInput";
|
|
204
|
+
const _ETOO = "ExecuteTrainingOperationOutput";
|
|
205
|
+
const _FBC = "ForwardBackwardConfig";
|
|
206
|
+
const _FBR = "ForwardBackwardResult";
|
|
207
|
+
const _FC = "ForwardConfig";
|
|
208
|
+
const _FR = "ForwardResult";
|
|
209
|
+
const _GSOR = "GetSamplingOperationResult";
|
|
210
|
+
const _GSORI = "GetSamplingOperationResultInput";
|
|
211
|
+
const _GSORO = "GetSamplingOperationResultOutput";
|
|
212
|
+
const _GTOR = "GetTrainingOperationResult";
|
|
213
|
+
const _GTORI = "GetTrainingOperationResultInput";
|
|
214
|
+
const _GTORO = "GetTrainingOperationResultOutput";
|
|
215
|
+
const _IB = "InferenceBody";
|
|
216
|
+
const _ISE = "InternalServerException";
|
|
217
|
+
const _LSC = "LoadStateConfig";
|
|
218
|
+
const _LSR = "LoadStateResult";
|
|
219
|
+
const _LWFSC = "LoadWeightsForSamplingConfig";
|
|
220
|
+
const _LWFSR = "LoadWeightsForSamplingResult";
|
|
221
|
+
const _MI = "ModelInput";
|
|
222
|
+
const _OC = "OperationConfig";
|
|
223
|
+
const _OR = "OperationResult";
|
|
224
|
+
const _OSC = "OptimizerStepConfig";
|
|
225
|
+
const _OSR = "OptimizerStepResult";
|
|
226
|
+
const _RNFE = "ResourceNotFoundException";
|
|
227
|
+
const _SC = "SampleConfig";
|
|
228
|
+
const _SOC = "SampleOperationConfig";
|
|
229
|
+
const _SOR = "SampleOperationResult";
|
|
230
|
+
const _SP = "SamplingParams";
|
|
231
|
+
const _SR = "SampleResponse";
|
|
232
|
+
const _SRS = "SampleResponseStream";
|
|
233
|
+
const _SS = "SampledSequence";
|
|
234
|
+
const _SSC = "SaveStateConfig";
|
|
235
|
+
const _SSL = "SampledSequenceList";
|
|
236
|
+
const _SSR = "SaveStateResult";
|
|
237
|
+
const _STS = "SampleTrainingSession";
|
|
238
|
+
const _STSI = "SampleTrainingSessionInput";
|
|
239
|
+
const _STSO = "SampleTrainingSessionOutput";
|
|
240
|
+
const _STSWRS = "SampleTrainingSessionWithResponseStream";
|
|
241
|
+
const _STSWRSI = "SampleTrainingSessionWithResponseStreamInput";
|
|
242
|
+
const _STSWRSO = "SampleTrainingSessionWithResponseStreamOutput";
|
|
243
|
+
const _STU = "SampleTokenUsage";
|
|
244
|
+
const _SWC = "SaveWeightsConfig";
|
|
245
|
+
const _SWR = "SaveWeightsResult";
|
|
246
|
+
const _TD = "TensorData";
|
|
247
|
+
const _TDM = "TensorDataMap";
|
|
248
|
+
const _TDML = "TensorDataMapList";
|
|
249
|
+
const _TE = "ThrottlingException";
|
|
250
|
+
const _TL = "TokenLogprob";
|
|
251
|
+
const _TLL = "TokenLogprobList";
|
|
252
|
+
const _TPLL = "TopkPromptLogprobsList";
|
|
253
|
+
const _TTU = "TrainingTokenUsage";
|
|
254
|
+
const _VE = "ValidationException";
|
|
255
|
+
const _XASMP = "X-Amzn-SageMaker-Model-Package";
|
|
256
|
+
const _a = "accept";
|
|
257
|
+
const _aPC = "adamParamsConfig";
|
|
258
|
+
const _b = "beta1";
|
|
259
|
+
const _be = "beta2";
|
|
260
|
+
const _bo = "body";
|
|
261
|
+
const _c = "client";
|
|
262
|
+
const _cL = "computeLogprobs";
|
|
263
|
+
const _cT = "clientToken";
|
|
264
|
+
const _cTo = "contentType";
|
|
265
|
+
const _ch = "chunks";
|
|
266
|
+
const _d = "decode";
|
|
267
|
+
const _dL = "datumList";
|
|
268
|
+
const _da = "data";
|
|
269
|
+
const _de = "description";
|
|
270
|
+
const _dt = "dtype";
|
|
271
|
+
const _e = "error";
|
|
272
|
+
const _eD = "errorDetails";
|
|
273
|
+
const _ep = "eps";
|
|
274
|
+
const _f = "forward";
|
|
275
|
+
const _fB = "forwardBackward";
|
|
276
|
+
const _gCN = "gradClipNorm";
|
|
277
|
+
const _h = "http";
|
|
278
|
+
const _hE = "httpError";
|
|
279
|
+
const _hH = "httpHeader";
|
|
280
|
+
const _iPL = "includePromptLogprobs";
|
|
281
|
+
const _l = "logprobs";
|
|
282
|
+
const _lFC = "lossFnConfig";
|
|
283
|
+
const _lFI = "lossFnInputs";
|
|
284
|
+
const _lFN = "lossFnName";
|
|
285
|
+
const _lFO = "lossFnOutputs";
|
|
286
|
+
const _lFOT = "lossFnOutputType";
|
|
287
|
+
const _lO = "loadOptimizer";
|
|
288
|
+
const _lPLR = "loraPlusLrRatio";
|
|
289
|
+
const _lR = "learningRate";
|
|
290
|
+
const _lS = "loadState";
|
|
291
|
+
const _lWFS = "loadWeightsForSampling";
|
|
292
|
+
const _lo = "logprob";
|
|
293
|
+
const _m = "message";
|
|
294
|
+
const _mI = "modelInput";
|
|
295
|
+
const _mPA = "modelPackageArn";
|
|
296
|
+
const _mT = "mediaType";
|
|
297
|
+
const _mTa = "maxTokens";
|
|
298
|
+
const _mW = "mergeWeights";
|
|
299
|
+
const _me = "metrics";
|
|
300
|
+
const _nS = "numSamples";
|
|
301
|
+
const _oC = "operationConfig";
|
|
302
|
+
const _oI = "operationId";
|
|
303
|
+
const _oR = "operationResult";
|
|
304
|
+
const _oS = "optimizerStep";
|
|
305
|
+
const _p = "prompt";
|
|
306
|
+
const _pL = "promptLogprobs";
|
|
307
|
+
const _pr = "prefill";
|
|
308
|
+
const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sagemakertrainingsessionruntime";
|
|
309
|
+
const _sN = "sequenceNumber";
|
|
310
|
+
const _sP = "samplingParams";
|
|
311
|
+
const _sR = "stopReason";
|
|
312
|
+
const _sS = "saveState";
|
|
313
|
+
const _sW = "saveWeights";
|
|
314
|
+
const _sa = "sample";
|
|
315
|
+
const _se = "server";
|
|
316
|
+
const _see = "seed";
|
|
317
|
+
const _sen = "sensitive";
|
|
318
|
+
const _seq = "sequences";
|
|
319
|
+
const _sh = "shape";
|
|
320
|
+
const _st = "streaming";
|
|
321
|
+
const _sta = "status";
|
|
322
|
+
const _sto = "stop";
|
|
323
|
+
const _t = "tokens";
|
|
324
|
+
const _tI = "tokenId";
|
|
325
|
+
const _tK = "topK";
|
|
326
|
+
const _tP = "topP";
|
|
327
|
+
const _tPL = "topkPromptLogprobs";
|
|
328
|
+
const _tSN = "trainingSessionName";
|
|
329
|
+
const _tT = "trainingTokens";
|
|
330
|
+
const _tU = "tokenUsage";
|
|
331
|
+
const _te = "temperature";
|
|
332
|
+
const _ts = "text/event-stream";
|
|
333
|
+
const _ty = "type";
|
|
334
|
+
const _wD = "weightDecay";
|
|
335
|
+
const n0 = "com.amazonaws.sagemakertrainingsessionruntime";
|
|
336
|
+
const _s_registry = new TypeRegistry(_s);
|
|
337
|
+
var SageMakerTrainingSessionRuntimeServiceException$ = [-3, _s, "SageMakerTrainingSessionRuntimeServiceException", 0, [], []];
|
|
338
|
+
_s_registry.registerError(SageMakerTrainingSessionRuntimeServiceException$, SageMakerTrainingSessionRuntimeServiceException);
|
|
339
|
+
const n0_registry = new TypeRegistry(n0);
|
|
340
|
+
var ConflictException$ = [-3, n0, _CE,
|
|
341
|
+
{ [_e]: _c, [_hE]: 409 },
|
|
342
|
+
[_m],
|
|
343
|
+
[0], 1
|
|
344
|
+
];
|
|
345
|
+
n0_registry.registerError(ConflictException$, ConflictException);
|
|
346
|
+
var InternalServerException$ = [-3, n0, _ISE,
|
|
347
|
+
{ [_e]: _se, [_hE]: 500 },
|
|
348
|
+
[_m],
|
|
349
|
+
[0], 1
|
|
350
|
+
];
|
|
351
|
+
n0_registry.registerError(InternalServerException$, InternalServerException);
|
|
352
|
+
var ResourceNotFoundException$ = [-3, n0, _RNFE,
|
|
353
|
+
{ [_e]: _c, [_hE]: 404 },
|
|
354
|
+
[_m],
|
|
355
|
+
[0], 1
|
|
356
|
+
];
|
|
357
|
+
n0_registry.registerError(ResourceNotFoundException$, ResourceNotFoundException);
|
|
358
|
+
var ThrottlingException$ = [-3, n0, _TE,
|
|
359
|
+
{ [_e]: _c, [_hE]: 429 },
|
|
360
|
+
[_m],
|
|
361
|
+
[0], 1
|
|
362
|
+
];
|
|
363
|
+
n0_registry.registerError(ThrottlingException$, ThrottlingException);
|
|
364
|
+
var ValidationException$ = [-3, n0, _VE,
|
|
365
|
+
{ [_e]: _c, [_hE]: 400 },
|
|
366
|
+
[_m],
|
|
367
|
+
[0], 1
|
|
368
|
+
];
|
|
369
|
+
n0_registry.registerError(ValidationException$, ValidationException);
|
|
370
|
+
const errorTypeRegistries = [
|
|
371
|
+
_s_registry,
|
|
372
|
+
n0_registry,
|
|
373
|
+
];
|
|
374
|
+
var InferenceBody = [0, n0, _IB, 8, 21];
|
|
375
|
+
var SampleResponseStream = [0, n0, _SRS, { [_mT]: _ts, [_sen]: 1, [_st]: 1 }, 42];
|
|
376
|
+
var AdamParamsConfig$ = [3, n0, _APC,
|
|
377
|
+
0,
|
|
378
|
+
[_lR, _b, _be, _ep, _wD, _gCN, _lPLR],
|
|
379
|
+
[1, 1, 1, 1, 1, 1, 1], 1
|
|
380
|
+
];
|
|
381
|
+
var ComputeLogprobsConfig$ = [3, n0, _CLC,
|
|
382
|
+
0,
|
|
383
|
+
[_p, _mPA],
|
|
384
|
+
[[() => ModelInput$, 0], 0], 1
|
|
385
|
+
];
|
|
386
|
+
var ComputeLogprobsResult$ = [3, n0, _CLR,
|
|
387
|
+
0,
|
|
388
|
+
[_l],
|
|
389
|
+
[64 | 1], 1
|
|
390
|
+
];
|
|
391
|
+
var Datum$ = [3, n0, _D,
|
|
392
|
+
8,
|
|
393
|
+
[_mI, _lFI],
|
|
394
|
+
[[() => ModelInput$, 0], () => TensorDataMap], 1
|
|
395
|
+
];
|
|
396
|
+
var EncodedTextChunk$ = [3, n0, _ETC,
|
|
397
|
+
0,
|
|
398
|
+
[_t, _ty],
|
|
399
|
+
[64 | 1, 0], 2
|
|
400
|
+
];
|
|
401
|
+
var ExecuteSamplingOperationInput$ = [3, n0, _ESOI,
|
|
402
|
+
0,
|
|
403
|
+
[_tSN, _oC],
|
|
404
|
+
[[0, 1], [() => SampleOperationConfig$, 0]], 2
|
|
405
|
+
];
|
|
406
|
+
var ExecuteSamplingOperationOutput$ = [3, n0, _ESOO,
|
|
407
|
+
0,
|
|
408
|
+
[_oI],
|
|
409
|
+
[0], 1
|
|
410
|
+
];
|
|
411
|
+
var ExecuteTrainingOperationInput$ = [3, n0, _ETOI,
|
|
412
|
+
0,
|
|
413
|
+
[_tSN, _sN, _oC, _cT],
|
|
414
|
+
[[0, 1], 1, [() => OperationConfig$, 0], 0], 3
|
|
415
|
+
];
|
|
416
|
+
var ExecuteTrainingOperationOutput$ = [3, n0, _ETOO,
|
|
417
|
+
0,
|
|
418
|
+
[_oI],
|
|
419
|
+
[0], 1
|
|
420
|
+
];
|
|
421
|
+
var ForwardBackwardConfig$ = [3, n0, _FBC,
|
|
422
|
+
0,
|
|
423
|
+
[_lFN, _dL, _lFC],
|
|
424
|
+
[0, [() => DatumList, 0], 15], 2
|
|
425
|
+
];
|
|
426
|
+
var ForwardBackwardResult$ = [3, n0, _FBR,
|
|
427
|
+
0,
|
|
428
|
+
[_lFOT, _lFO, _me, _tU],
|
|
429
|
+
[0, () => TensorDataMapList, 128 | 1, () => TrainingTokenUsage$]
|
|
430
|
+
];
|
|
431
|
+
var ForwardConfig$ = [3, n0, _FC,
|
|
432
|
+
0,
|
|
433
|
+
[_lFN, _dL, _lFC],
|
|
434
|
+
[0, [() => DatumList, 0], 15], 2
|
|
435
|
+
];
|
|
436
|
+
var ForwardResult$ = [3, n0, _FR,
|
|
437
|
+
0,
|
|
438
|
+
[_lFOT, _lFO, _me, _tU],
|
|
439
|
+
[0, () => TensorDataMapList, 128 | 1, () => TrainingTokenUsage$]
|
|
440
|
+
];
|
|
441
|
+
var GetSamplingOperationResultInput$ = [3, n0, _GSORI,
|
|
442
|
+
0,
|
|
443
|
+
[_tSN, _oI],
|
|
444
|
+
[[0, 1], [0, 1]], 2
|
|
445
|
+
];
|
|
446
|
+
var GetSamplingOperationResultOutput$ = [3, n0, _GSORO,
|
|
447
|
+
0,
|
|
448
|
+
[_sta, _oR, _eD],
|
|
449
|
+
[0, [() => SampleOperationResult$, 0], 0], 1
|
|
450
|
+
];
|
|
451
|
+
var GetTrainingOperationResultInput$ = [3, n0, _GTORI,
|
|
452
|
+
0,
|
|
453
|
+
[_tSN, _oI],
|
|
454
|
+
[[0, 1], [0, 1]], 2
|
|
455
|
+
];
|
|
456
|
+
var GetTrainingOperationResultOutput$ = [3, n0, _GTORO,
|
|
457
|
+
0,
|
|
458
|
+
[_sta, _oR, _eD, _tU],
|
|
459
|
+
[0, () => OperationResult$, 0, () => TrainingTokenUsage$], 1
|
|
460
|
+
];
|
|
461
|
+
var LoadStateConfig$ = [3, n0, _LSC,
|
|
462
|
+
0,
|
|
463
|
+
[_mPA, _lO],
|
|
464
|
+
[0, 2], 2
|
|
465
|
+
];
|
|
466
|
+
var LoadStateResult$ = [3, n0, _LSR,
|
|
467
|
+
0,
|
|
468
|
+
[],
|
|
469
|
+
[]
|
|
470
|
+
];
|
|
471
|
+
var LoadWeightsForSamplingConfig$ = [3, n0, _LWFSC,
|
|
472
|
+
0,
|
|
473
|
+
[_mPA],
|
|
474
|
+
[0], 1
|
|
475
|
+
];
|
|
476
|
+
var LoadWeightsForSamplingResult$ = [3, n0, _LWFSR,
|
|
477
|
+
0,
|
|
478
|
+
[],
|
|
479
|
+
[]
|
|
480
|
+
];
|
|
481
|
+
var ModelInput$ = [3, n0, _MI,
|
|
482
|
+
8,
|
|
483
|
+
[_ch],
|
|
484
|
+
[() => EncodedTextChunkList], 1
|
|
485
|
+
];
|
|
486
|
+
var OptimizerStepConfig$ = [3, n0, _OSC,
|
|
487
|
+
0,
|
|
488
|
+
[_aPC],
|
|
489
|
+
[() => AdamParamsConfig$], 1
|
|
490
|
+
];
|
|
491
|
+
var OptimizerStepResult$ = [3, n0, _OSR,
|
|
492
|
+
0,
|
|
493
|
+
[_me],
|
|
494
|
+
[128 | 1]
|
|
495
|
+
];
|
|
496
|
+
var SampleConfig$ = [3, n0, _SC,
|
|
497
|
+
0,
|
|
498
|
+
[_p, _nS, _sP, _iPL, _tPL, _mPA],
|
|
499
|
+
[[() => ModelInput$, 0], 1, () => SamplingParams$, 2, 1, 0], 3
|
|
500
|
+
];
|
|
501
|
+
var SampledSequence$ = [3, n0, _SS,
|
|
502
|
+
0,
|
|
503
|
+
[_sR, _t, _l, _tU],
|
|
504
|
+
[0, 64 | 1, 64 | 1, () => SampleTokenUsage$], 2
|
|
505
|
+
];
|
|
506
|
+
var SampleResponse$ = [3, n0, _SR,
|
|
507
|
+
8,
|
|
508
|
+
[_seq, _pL, _tPL],
|
|
509
|
+
[() => SampledSequenceList, 64 | 1, () => TopkPromptLogprobsList], 1
|
|
510
|
+
];
|
|
511
|
+
var SampleTokenUsage$ = [3, n0, _STU,
|
|
512
|
+
0,
|
|
513
|
+
[_pr, _d],
|
|
514
|
+
[1, 1], 2
|
|
515
|
+
];
|
|
516
|
+
var SampleTrainingSessionInput$ = [3, n0, _STSI,
|
|
517
|
+
0,
|
|
518
|
+
[_tSN, _cTo, _a, _mPA, _bo],
|
|
519
|
+
[[0, 1], [0, { [_hH]: _CT }], [0, { [_hH]: _A }], [0, { [_hH]: _XASMP }], [() => InferenceBody, 16]], 1
|
|
520
|
+
];
|
|
521
|
+
var SampleTrainingSessionOutput$ = [3, n0, _STSO,
|
|
522
|
+
0,
|
|
523
|
+
[_bo, _cTo],
|
|
524
|
+
[[() => InferenceBody, 16], [0, { [_hH]: _CT }]], 1
|
|
525
|
+
];
|
|
526
|
+
var SampleTrainingSessionWithResponseStreamInput$ = [3, n0, _STSWRSI,
|
|
527
|
+
0,
|
|
528
|
+
[_tSN, _cTo, _a, _mPA, _bo],
|
|
529
|
+
[[0, 1], [0, { [_hH]: _CT }], [0, { [_hH]: _A }], [0, { [_hH]: _XASMP }], [() => InferenceBody, 16]], 1
|
|
530
|
+
];
|
|
531
|
+
var SampleTrainingSessionWithResponseStreamOutput$ = [3, n0, _STSWRSO,
|
|
532
|
+
0,
|
|
533
|
+
[_bo, _cTo],
|
|
534
|
+
[[() => SampleResponseStream, 16], [0, { [_hH]: _CT }]], 1
|
|
535
|
+
];
|
|
536
|
+
var SamplingParams$ = [3, n0, _SP,
|
|
537
|
+
0,
|
|
538
|
+
[_mTa, _te, _tK, _tP, _see, _sto],
|
|
539
|
+
[1, 1, 1, 1, 1, 64 | 0], 1
|
|
540
|
+
];
|
|
541
|
+
var SaveStateConfig$ = [3, n0, _SSC,
|
|
542
|
+
0,
|
|
543
|
+
[_de],
|
|
544
|
+
[0]
|
|
545
|
+
];
|
|
546
|
+
var SaveStateResult$ = [3, n0, _SSR,
|
|
547
|
+
0,
|
|
548
|
+
[_mPA],
|
|
549
|
+
[0], 1
|
|
550
|
+
];
|
|
551
|
+
var SaveWeightsConfig$ = [3, n0, _SWC,
|
|
552
|
+
0,
|
|
553
|
+
[_mW, _de],
|
|
554
|
+
[2, 0]
|
|
555
|
+
];
|
|
556
|
+
var SaveWeightsResult$ = [3, n0, _SWR,
|
|
557
|
+
0,
|
|
558
|
+
[_mPA],
|
|
559
|
+
[0]
|
|
560
|
+
];
|
|
561
|
+
var TensorData$ = [3, n0, _TD,
|
|
562
|
+
0,
|
|
563
|
+
[_da, _dt, _sh],
|
|
564
|
+
[15, 0, 64 | 1], 2
|
|
565
|
+
];
|
|
566
|
+
var TokenLogprob$ = [3, n0, _TL,
|
|
567
|
+
0,
|
|
568
|
+
[_tI, _lo],
|
|
569
|
+
[1, 1], 2
|
|
570
|
+
];
|
|
571
|
+
var TrainingTokenUsage$ = [3, n0, _TTU,
|
|
572
|
+
0,
|
|
573
|
+
[_tT],
|
|
574
|
+
[1]
|
|
575
|
+
];
|
|
576
|
+
var DatumList = [1, n0, _DL,
|
|
577
|
+
0, [() => Datum$,
|
|
578
|
+
0]
|
|
579
|
+
];
|
|
580
|
+
var EncodedTextChunkList = [1, n0, _ETCL,
|
|
581
|
+
0, () => EncodedTextChunk$
|
|
582
|
+
];
|
|
583
|
+
var SampledSequenceList = [1, n0, _SSL,
|
|
584
|
+
0, () => SampledSequence$
|
|
585
|
+
];
|
|
586
|
+
var TensorDataMapList = [1, n0, _TDML,
|
|
587
|
+
0, () => TensorDataMap
|
|
588
|
+
];
|
|
589
|
+
var TokenLogprobList = [1, n0, _TLL,
|
|
590
|
+
0, () => TokenLogprob$
|
|
591
|
+
];
|
|
592
|
+
var TopkPromptLogprobsList = [1, n0, _TPLL,
|
|
593
|
+
0, () => TokenLogprobList
|
|
594
|
+
];
|
|
595
|
+
var TensorDataMap = [2, n0, _TDM,
|
|
596
|
+
0, 0, () => TensorData$
|
|
597
|
+
];
|
|
598
|
+
var OperationConfig$ = [4, n0, _OC,
|
|
599
|
+
0,
|
|
600
|
+
[_f, _fB, _oS, _sW, _sS, _lS],
|
|
601
|
+
[[() => ForwardConfig$, 0], [() => ForwardBackwardConfig$, 0], () => OptimizerStepConfig$, () => SaveWeightsConfig$, () => SaveStateConfig$, () => LoadStateConfig$]
|
|
602
|
+
];
|
|
603
|
+
var OperationResult$ = [4, n0, _OR,
|
|
604
|
+
0,
|
|
605
|
+
[_f, _fB, _oS, _sW, _sS, _lS],
|
|
606
|
+
[() => ForwardResult$, () => ForwardBackwardResult$, () => OptimizerStepResult$, () => SaveWeightsResult$, () => SaveStateResult$, () => LoadStateResult$]
|
|
607
|
+
];
|
|
608
|
+
var SampleOperationConfig$ = [4, n0, _SOC,
|
|
609
|
+
0,
|
|
610
|
+
[_sa, _cL, _lWFS],
|
|
611
|
+
[[() => SampleConfig$, 0], [() => ComputeLogprobsConfig$, 0], () => LoadWeightsForSamplingConfig$]
|
|
612
|
+
];
|
|
613
|
+
var SampleOperationResult$ = [4, n0, _SOR,
|
|
614
|
+
0,
|
|
615
|
+
[_sa, _cL, _lWFS],
|
|
616
|
+
[[() => SampleResponse$, 0], () => ComputeLogprobsResult$, () => LoadWeightsForSamplingResult$]
|
|
617
|
+
];
|
|
618
|
+
var ExecuteSamplingOperation$ = [9, n0, _ESO,
|
|
619
|
+
{ [_h]: ["POST", "/v1/training-sessions/{trainingSessionName}/sampling-operations", 200] }, () => ExecuteSamplingOperationInput$, () => ExecuteSamplingOperationOutput$
|
|
620
|
+
];
|
|
621
|
+
var ExecuteTrainingOperation$ = [9, n0, _ETO,
|
|
622
|
+
{ [_h]: ["POST", "/v1/training-sessions/{trainingSessionName}/operations", 200] }, () => ExecuteTrainingOperationInput$, () => ExecuteTrainingOperationOutput$
|
|
623
|
+
];
|
|
624
|
+
var GetSamplingOperationResult$ = [9, n0, _GSOR,
|
|
625
|
+
{ [_h]: ["GET", "/v1/training-sessions/{trainingSessionName}/sampling-operations/{operationId}", 200] }, () => GetSamplingOperationResultInput$, () => GetSamplingOperationResultOutput$
|
|
626
|
+
];
|
|
627
|
+
var GetTrainingOperationResult$ = [9, n0, _GTOR,
|
|
628
|
+
{ [_h]: ["GET", "/v1/training-sessions/{trainingSessionName}/operations/{operationId}", 200] }, () => GetTrainingOperationResultInput$, () => GetTrainingOperationResultOutput$
|
|
629
|
+
];
|
|
630
|
+
var SampleTrainingSession$ = [9, n0, _STS,
|
|
631
|
+
{ [_h]: ["POST", "/training-sessions/{trainingSessionName}/sample", 200] }, () => SampleTrainingSessionInput$, () => SampleTrainingSessionOutput$
|
|
632
|
+
];
|
|
633
|
+
var SampleTrainingSessionWithResponseStream$ = [9, n0, _STSWRS,
|
|
634
|
+
{ [_h]: ["POST", "/training-sessions/{trainingSessionName}/sample-with-response-stream", 200] }, () => SampleTrainingSessionWithResponseStreamInput$, () => SampleTrainingSessionWithResponseStreamOutput$
|
|
635
|
+
];
|
|
636
|
+
|
|
637
|
+
const getRuntimeConfig$1 = (config) => {
|
|
638
|
+
return {
|
|
639
|
+
apiVersion: "2025-02-10",
|
|
640
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
641
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
642
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
643
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
644
|
+
extensions: config?.extensions ?? [],
|
|
645
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSageMakerTrainingSessionRuntimeHttpAuthSchemeProvider,
|
|
646
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
647
|
+
{
|
|
648
|
+
schemeId: "aws.auth#sigv4",
|
|
649
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
650
|
+
signer: new AwsSdkSigV4Signer(),
|
|
651
|
+
},
|
|
652
|
+
],
|
|
653
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
654
|
+
protocol: config?.protocol ?? AwsRestJsonProtocol,
|
|
655
|
+
protocolSettings: config?.protocolSettings ?? {
|
|
656
|
+
defaultNamespace: "com.amazonaws.sagemakertrainingsessionruntime",
|
|
657
|
+
errorTypeRegistries,
|
|
658
|
+
version: "2025-02-10",
|
|
659
|
+
serviceTarget: "LegoRouterService",
|
|
660
|
+
},
|
|
661
|
+
sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin,
|
|
662
|
+
serviceId: config?.serviceId ?? "SageMakerTrainingSessionRuntime",
|
|
663
|
+
sha256: config?.sha256 ?? Sha256,
|
|
664
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
665
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
666
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
const getRuntimeConfig = (config) => {
|
|
671
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
672
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
673
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
674
|
+
const clientSharedValues = getRuntimeConfig$1(config);
|
|
675
|
+
emitWarningIfUnsupportedVersion$1(process.version);
|
|
676
|
+
const loaderConfig = {
|
|
677
|
+
profile: config?.profile,
|
|
678
|
+
logger: clientSharedValues.logger,
|
|
679
|
+
};
|
|
680
|
+
return {
|
|
681
|
+
...clientSharedValues,
|
|
682
|
+
...config,
|
|
683
|
+
runtime: "node",
|
|
684
|
+
defaultsMode,
|
|
685
|
+
authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
686
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
687
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
|
|
688
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
689
|
+
maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
690
|
+
region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
691
|
+
requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
692
|
+
retryMode: config?.retryMode ??
|
|
693
|
+
loadConfig({
|
|
694
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
695
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
696
|
+
}, config),
|
|
697
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
698
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
699
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
700
|
+
userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
701
|
+
};
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
705
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
706
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
707
|
+
let _credentials = runtimeConfig.credentials;
|
|
708
|
+
return {
|
|
709
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
710
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
711
|
+
if (index === -1) {
|
|
712
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
httpAuthSchemes() {
|
|
719
|
+
return _httpAuthSchemes;
|
|
720
|
+
},
|
|
721
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
722
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
723
|
+
},
|
|
724
|
+
httpAuthSchemeProvider() {
|
|
725
|
+
return _httpAuthSchemeProvider;
|
|
726
|
+
},
|
|
727
|
+
setCredentials(credentials) {
|
|
728
|
+
_credentials = credentials;
|
|
729
|
+
},
|
|
730
|
+
credentials() {
|
|
731
|
+
return _credentials;
|
|
732
|
+
},
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
736
|
+
return {
|
|
737
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
738
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
739
|
+
credentials: config.credentials(),
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
744
|
+
const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
745
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
746
|
+
return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
class SageMakerTrainingSessionRuntimeClient extends Client {
|
|
750
|
+
config;
|
|
751
|
+
constructor(...[configuration]) {
|
|
752
|
+
const _config_0 = getRuntimeConfig(configuration || {});
|
|
753
|
+
super(_config_0);
|
|
754
|
+
this.initConfig = _config_0;
|
|
755
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
756
|
+
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
757
|
+
const _config_3 = resolveRetryConfig(_config_2);
|
|
758
|
+
const _config_4 = resolveRegionConfig(_config_3);
|
|
759
|
+
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
760
|
+
const _config_6 = resolveEndpointConfig(_config_5);
|
|
761
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
762
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
763
|
+
this.config = _config_8;
|
|
764
|
+
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
|
|
765
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
766
|
+
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
767
|
+
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
768
|
+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
769
|
+
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
770
|
+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
771
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
772
|
+
httpAuthSchemeParametersProvider: defaultSageMakerTrainingSessionRuntimeHttpAuthSchemeParametersProvider,
|
|
773
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
774
|
+
"aws.auth#sigv4": config.credentials,
|
|
775
|
+
}),
|
|
776
|
+
}));
|
|
777
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
778
|
+
}
|
|
779
|
+
destroy() {
|
|
780
|
+
super.destroy();
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
const command = makeBuilder(commonParams, "LegoRouterService", "SageMakerTrainingSessionRuntimeClient", getEndpointPlugin);
|
|
785
|
+
const _ep0 = {};
|
|
786
|
+
const _mw0 = (Command, cs, config, o) => [];
|
|
787
|
+
|
|
788
|
+
class ExecuteSamplingOperationCommand extends command(_ep0, _mw0, "ExecuteSamplingOperation", ExecuteSamplingOperation$) {
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
class ExecuteTrainingOperationCommand extends command(_ep0, _mw0, "ExecuteTrainingOperation", ExecuteTrainingOperation$) {
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
class GetSamplingOperationResultCommand extends command(_ep0, _mw0, "GetSamplingOperationResult", GetSamplingOperationResult$) {
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
class GetTrainingOperationResultCommand extends command(_ep0, _mw0, "GetTrainingOperationResult", GetTrainingOperationResult$) {
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
class SampleTrainingSessionCommand extends command(_ep0, _mw0, "SampleTrainingSession", SampleTrainingSession$) {
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
class SampleTrainingSessionWithResponseStreamCommand extends command(_ep0, _mw0, "SampleTrainingSessionWithResponseStream", SampleTrainingSessionWithResponseStream$) {
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
const commands = {
|
|
807
|
+
ExecuteSamplingOperationCommand,
|
|
808
|
+
ExecuteTrainingOperationCommand,
|
|
809
|
+
GetSamplingOperationResultCommand,
|
|
810
|
+
GetTrainingOperationResultCommand,
|
|
811
|
+
SampleTrainingSessionCommand,
|
|
812
|
+
SampleTrainingSessionWithResponseStreamCommand,
|
|
813
|
+
};
|
|
814
|
+
class SageMakerTrainingSessionRuntime extends SageMakerTrainingSessionRuntimeClient {
|
|
815
|
+
}
|
|
816
|
+
createAggregatedClient(commands, SageMakerTrainingSessionRuntime);
|
|
817
|
+
|
|
818
|
+
const EncodedTextChunkType = {
|
|
819
|
+
ENCODED_TEXT: "encoded_text",
|
|
820
|
+
};
|
|
821
|
+
const LossFnName = {
|
|
822
|
+
CISPO: "cispo",
|
|
823
|
+
CROSS_ENTROPY: "cross_entropy",
|
|
824
|
+
IMPORTANCE_SAMPLING: "importance_sampling",
|
|
825
|
+
PPO: "ppo",
|
|
826
|
+
};
|
|
827
|
+
const StopReason = {
|
|
828
|
+
LENGTH: "length",
|
|
829
|
+
STOP: "stop",
|
|
830
|
+
};
|
|
831
|
+
const RequestStatus = {
|
|
832
|
+
COMPLETED: "Completed",
|
|
833
|
+
FAILED: "Failed",
|
|
834
|
+
IN_PROGRESS: "InProgress",
|
|
835
|
+
PENDING: "Pending",
|
|
836
|
+
SKIPPED: "Skipped",
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
exports.AdamParamsConfig$ = AdamParamsConfig$;
|
|
840
|
+
exports.ComputeLogprobsConfig$ = ComputeLogprobsConfig$;
|
|
841
|
+
exports.ComputeLogprobsResult$ = ComputeLogprobsResult$;
|
|
842
|
+
exports.ConflictException = ConflictException;
|
|
843
|
+
exports.ConflictException$ = ConflictException$;
|
|
844
|
+
exports.Datum$ = Datum$;
|
|
845
|
+
exports.EncodedTextChunk$ = EncodedTextChunk$;
|
|
846
|
+
exports.EncodedTextChunkType = EncodedTextChunkType;
|
|
847
|
+
exports.ExecuteSamplingOperation$ = ExecuteSamplingOperation$;
|
|
848
|
+
exports.ExecuteSamplingOperationCommand = ExecuteSamplingOperationCommand;
|
|
849
|
+
exports.ExecuteSamplingOperationInput$ = ExecuteSamplingOperationInput$;
|
|
850
|
+
exports.ExecuteSamplingOperationOutput$ = ExecuteSamplingOperationOutput$;
|
|
851
|
+
exports.ExecuteTrainingOperation$ = ExecuteTrainingOperation$;
|
|
852
|
+
exports.ExecuteTrainingOperationCommand = ExecuteTrainingOperationCommand;
|
|
853
|
+
exports.ExecuteTrainingOperationInput$ = ExecuteTrainingOperationInput$;
|
|
854
|
+
exports.ExecuteTrainingOperationOutput$ = ExecuteTrainingOperationOutput$;
|
|
855
|
+
exports.ForwardBackwardConfig$ = ForwardBackwardConfig$;
|
|
856
|
+
exports.ForwardBackwardResult$ = ForwardBackwardResult$;
|
|
857
|
+
exports.ForwardConfig$ = ForwardConfig$;
|
|
858
|
+
exports.ForwardResult$ = ForwardResult$;
|
|
859
|
+
exports.GetSamplingOperationResult$ = GetSamplingOperationResult$;
|
|
860
|
+
exports.GetSamplingOperationResultCommand = GetSamplingOperationResultCommand;
|
|
861
|
+
exports.GetSamplingOperationResultInput$ = GetSamplingOperationResultInput$;
|
|
862
|
+
exports.GetSamplingOperationResultOutput$ = GetSamplingOperationResultOutput$;
|
|
863
|
+
exports.GetTrainingOperationResult$ = GetTrainingOperationResult$;
|
|
864
|
+
exports.GetTrainingOperationResultCommand = GetTrainingOperationResultCommand;
|
|
865
|
+
exports.GetTrainingOperationResultInput$ = GetTrainingOperationResultInput$;
|
|
866
|
+
exports.GetTrainingOperationResultOutput$ = GetTrainingOperationResultOutput$;
|
|
867
|
+
exports.InternalServerException = InternalServerException;
|
|
868
|
+
exports.InternalServerException$ = InternalServerException$;
|
|
869
|
+
exports.LoadStateConfig$ = LoadStateConfig$;
|
|
870
|
+
exports.LoadStateResult$ = LoadStateResult$;
|
|
871
|
+
exports.LoadWeightsForSamplingConfig$ = LoadWeightsForSamplingConfig$;
|
|
872
|
+
exports.LoadWeightsForSamplingResult$ = LoadWeightsForSamplingResult$;
|
|
873
|
+
exports.LossFnName = LossFnName;
|
|
874
|
+
exports.ModelInput$ = ModelInput$;
|
|
875
|
+
exports.OperationConfig$ = OperationConfig$;
|
|
876
|
+
exports.OperationResult$ = OperationResult$;
|
|
877
|
+
exports.OptimizerStepConfig$ = OptimizerStepConfig$;
|
|
878
|
+
exports.OptimizerStepResult$ = OptimizerStepResult$;
|
|
879
|
+
exports.RequestStatus = RequestStatus;
|
|
880
|
+
exports.ResourceNotFoundException = ResourceNotFoundException;
|
|
881
|
+
exports.ResourceNotFoundException$ = ResourceNotFoundException$;
|
|
882
|
+
exports.SageMakerTrainingSessionRuntime = SageMakerTrainingSessionRuntime;
|
|
883
|
+
exports.SageMakerTrainingSessionRuntimeClient = SageMakerTrainingSessionRuntimeClient;
|
|
884
|
+
exports.SageMakerTrainingSessionRuntimeServiceException = SageMakerTrainingSessionRuntimeServiceException;
|
|
885
|
+
exports.SageMakerTrainingSessionRuntimeServiceException$ = SageMakerTrainingSessionRuntimeServiceException$;
|
|
886
|
+
exports.SampleConfig$ = SampleConfig$;
|
|
887
|
+
exports.SampleOperationConfig$ = SampleOperationConfig$;
|
|
888
|
+
exports.SampleOperationResult$ = SampleOperationResult$;
|
|
889
|
+
exports.SampleResponse$ = SampleResponse$;
|
|
890
|
+
exports.SampleTokenUsage$ = SampleTokenUsage$;
|
|
891
|
+
exports.SampleTrainingSession$ = SampleTrainingSession$;
|
|
892
|
+
exports.SampleTrainingSessionCommand = SampleTrainingSessionCommand;
|
|
893
|
+
exports.SampleTrainingSessionInput$ = SampleTrainingSessionInput$;
|
|
894
|
+
exports.SampleTrainingSessionOutput$ = SampleTrainingSessionOutput$;
|
|
895
|
+
exports.SampleTrainingSessionWithResponseStream$ = SampleTrainingSessionWithResponseStream$;
|
|
896
|
+
exports.SampleTrainingSessionWithResponseStreamCommand = SampleTrainingSessionWithResponseStreamCommand;
|
|
897
|
+
exports.SampleTrainingSessionWithResponseStreamInput$ = SampleTrainingSessionWithResponseStreamInput$;
|
|
898
|
+
exports.SampleTrainingSessionWithResponseStreamOutput$ = SampleTrainingSessionWithResponseStreamOutput$;
|
|
899
|
+
exports.SampledSequence$ = SampledSequence$;
|
|
900
|
+
exports.SamplingParams$ = SamplingParams$;
|
|
901
|
+
exports.SaveStateConfig$ = SaveStateConfig$;
|
|
902
|
+
exports.SaveStateResult$ = SaveStateResult$;
|
|
903
|
+
exports.SaveWeightsConfig$ = SaveWeightsConfig$;
|
|
904
|
+
exports.SaveWeightsResult$ = SaveWeightsResult$;
|
|
905
|
+
exports.StopReason = StopReason;
|
|
906
|
+
exports.TensorData$ = TensorData$;
|
|
907
|
+
exports.ThrottlingException = ThrottlingException;
|
|
908
|
+
exports.ThrottlingException$ = ThrottlingException$;
|
|
909
|
+
exports.TokenLogprob$ = TokenLogprob$;
|
|
910
|
+
exports.TrainingTokenUsage$ = TrainingTokenUsage$;
|
|
911
|
+
exports.ValidationException = ValidationException;
|
|
912
|
+
exports.ValidationException$ = ValidationException$;
|
|
913
|
+
exports.errorTypeRegistries = errorTypeRegistries;
|