AgitatedDove14 Hi. I and Vlad work together and I think I can paraphrase his question.
We’ve got out clearml-serving and we trained our model. Then we want to add that model to serving. But we need to write our custom preprocess.py
in which we need to call method generate from our model. But we do not exactly understand how we can load/refer to our model.
In examples about custom engine we’ve got thisclass Preprocess(object): """ Notice the execution flows is synchronous as follows: 1. RestAPI(...) -> body: dict 2. preprocess(body: dict, ...) -> data: Any 3. process(data: Any, ...) -> data: Any 4. postprocess(data: Any, ...) -> result: dict 5. RestAPI(result: dict) -> returned request """ def __init__(self): """ Set any initial property on the Task (usually model object) Notice these properties will be accessed from multiple threads. If you need a stateful (per request) data, use the
statedict argument passed to pre/post/process functions """ # set internal state, this will be called only once. (i.e. not per request) self._model = None
and the question is what we need to write in self._model
to load our model in serving? Or how we can refer to our model in Preprocess
class