mirror of
https://github.com/clearml/clearml-serving
synced 2025-06-26 18:16:00 +00:00
Add model metric logging
This commit is contained in:
@@ -7,14 +7,14 @@ class Preprocess(object):
|
||||
# set internal state, this will be called only once. (i.e. not per request)
|
||||
pass
|
||||
|
||||
def postprocess(self, data: List[dict]) -> dict:
|
||||
def postprocess(self, data: List[dict], collect_custom_statistics_fn=None) -> dict:
|
||||
# we will here average the results and return the new value
|
||||
# assume data is a list of dicts greater than 1
|
||||
|
||||
# average result
|
||||
return dict(y=0.5 * data[0]['y'][0] + 0.5 * data[1]['y'][0])
|
||||
|
||||
def process(self, data: Any) -> Any:
|
||||
def process(self, data: Any, collect_custom_statistics_fn=None) -> Any:
|
||||
"""
|
||||
do something with the actual data, return any type of object.
|
||||
The returned object will be passed as is to the postprocess function engine
|
||||
|
||||
Reference in New Issue
Block a user