mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:46:30 +00:00
82b3b526a7
file load works, suite can start up
20 lines
631 B
Cython
20 lines
631 B
Cython
import msgpack
|
|
|
|
cdef class RemoteCommand:
|
|
def __init__(self, CommandType command_type, str filename, bytes data):
|
|
self.command_type = command_type
|
|
self.filename = filename
|
|
self.data = data
|
|
|
|
def __str__(self):
|
|
command_type_names = {
|
|
1: "INFERENCE",
|
|
2: "LOAD",
|
|
}
|
|
return f'{command_type_names[self.command_type]}: {self.filename}'
|
|
|
|
@staticmethod
|
|
cdef from_msgpack(bytes data):
|
|
unpacked = msgpack.unpackb(data, strict_map_key=False)
|
|
return RemoteCommand(unpacked.get("CommandType"), unpacked.get("Filename"), unpacked.get("Data"))
|