response¶
response
¶
The status message a remote job sends back to the client.
Each update NDIF pushes for a job — whether streamed over a blocking websocket or
saved to the object store and polled — arrives as a ResponseModel. Its
Status names where the job is in its lifecycle; on COMPLETED the
returned values ride in data
and what the run cost the server rides in
meta.
Status
¶
Bases: str, Enum
Where a remote job is in its lifecycle (or a transient log message).
ResponseModel
¶
Bases: BaseModel
One status update for a remote job, optionally carrying its result.
Streamed over the websocket for a blocking job, or saved to the object store
and fetched by the client for a non-blocking one. data holds the
saved values only on a COMPLETED response, and meta
what the run cost on the server -- on COMPLETED and on a failure alike,
since a job that ran out of memory or timed out is exactly when its cost is
worth reading.
model_config
class-attribute
instance-attribute
¶
pickle
¶
Serialize to bytes via torch.save (carries tensors in data).
Pickle protocol 4: torch.save's default protocol 2 has no bytes
opcode and writes a bytes value in data through a latin-1
str, 1.5x the size and several times slower to save and load.
unpickle
classmethod
¶
unpickle(data: bytes) -> ResponseModel
Rebuild a ResponseModel from pickle bytes (onto CPU).