MCPcopy Create free account
hub / github.com/apple/coremltools / decode

Method decode

coremltools/modelrunner/ModelRunner/ModelService.swift:986–999  ·  view source on GitHub ↗
(_ request: DeviceCtlSocket.Request)

Source from the content-addressed store, hash-verified

984 init(request: DeviceCtlSocket.Request) throws {
985 let decoder = JSONDecoder()
986 func decode<T>(_ request: DeviceCtlSocket.Request) throws -> T where T: Codable {
987 let jsonRequest = try decoder.decode(JSONRPCRequest<T>.self, from: request.payload)
988 guard let params = jsonRequest.params else {
989 throw Model.Error.malformedRequest(
990 details:
991 """
992 Missing parameters for '\(request.name)'.
993 The ModelService requires non-nil parameters for this request type.
994 """
995 )
996 }
997
998 return params
999 }
1000
1001 switch request.name {
1002 case "MLModelService.Load":

Callers 8

_macos_versionFunction · 0.45
parse_stringFunction · 0.45
initMethod · 0.45
_to_unicodeFunction · 0.45
_macos_versionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected