Skip to content
Merged
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
88 changes: 44 additions & 44 deletions packages_generated/inference/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,50 +77,6 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => {
} as Endpoint
}

const unmarshalModelSupportedQuantization = (
data: unknown,
): ModelSupportedQuantization => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ModelSupportedQuantization' failed as data isn't a dictionary.`,
)
}

return {
allowed: data.allowed,
maxContextSize: data.max_context_size,
quantizationBits: data.quantization_bits,
} as ModelSupportedQuantization
}

const unmarshalModelSupportedNode = (data: unknown): ModelSupportedNode => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ModelSupportedNode' failed as data isn't a dictionary.`,
)
}

return {
nodeTypeName: data.node_type_name,
quantizations: unmarshalArrayOfObject(
data.quantizations,
unmarshalModelSupportedQuantization,
),
} as ModelSupportedNode
}

export const unmarshalModelSupportInfo = (data: unknown): ModelSupportInfo => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ModelSupportInfo' failed as data isn't a dictionary.`,
)
}

return {
nodes: unmarshalArrayOfObject(data.nodes, unmarshalModelSupportedNode),
} as ModelSupportInfo
}

const unmarshalDeploymentQuantization = (
data: unknown,
): DeploymentQuantization => {
Expand Down Expand Up @@ -165,6 +121,50 @@ export const unmarshalDeployment = (data: unknown): Deployment => {
} as Deployment
}

const unmarshalModelSupportedQuantization = (
data: unknown,
): ModelSupportedQuantization => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ModelSupportedQuantization' failed as data isn't a dictionary.`,
)
}

return {
allowed: data.allowed,
maxContextSize: data.max_context_size,
quantizationBits: data.quantization_bits,
} as ModelSupportedQuantization
}

const unmarshalModelSupportedNode = (data: unknown): ModelSupportedNode => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ModelSupportedNode' failed as data isn't a dictionary.`,
)
}

return {
nodeTypeName: data.node_type_name,
quantizations: unmarshalArrayOfObject(
data.quantizations,
unmarshalModelSupportedQuantization,
),
} as ModelSupportedNode
}

const unmarshalModelSupportInfo = (data: unknown): ModelSupportInfo => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ModelSupportInfo' failed as data isn't a dictionary.`,
)
}

return {
nodes: unmarshalArrayOfObject(data.nodes, unmarshalModelSupportedNode),
} as ModelSupportInfo
}

export const unmarshalModel = (data: unknown): Model => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down