mirror of
https://github.com/clearml/clearml-serving
synced 2025-01-31 02:46:54 +00:00
Add traceback for failing to load preprocess class (#57)
This commit is contained in:
parent
4a737b95c6
commit
e4c07c756a
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
import traceback
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional, Any, Callable, List
|
from typing import Optional, Any, Callable, List
|
||||||
|
|
||||||
@ -48,8 +49,8 @@ class BasePreprocessRequest(object):
|
|||||||
try:
|
try:
|
||||||
self._instantiate_custom_preprocess_cls(task)
|
self._instantiate_custom_preprocess_cls(task)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
raise ValueError("Error: Failed loading preprocess code for \'{}\': {}".format(
|
raise ValueError("Error: Failed loading preprocess code for \'{}\': {}\n\n{}".format(
|
||||||
self.model_endpoint.preprocess_artifact, ex))
|
self.model_endpoint.preprocess_artifact, ex, traceback.format_exc()))
|
||||||
|
|
||||||
def _instantiate_custom_preprocess_cls(self, task: Task) -> None:
|
def _instantiate_custom_preprocess_cls(self, task: Task) -> None:
|
||||||
path = task.artifacts[self.model_endpoint.preprocess_artifact].get_local_copy(extract_archive=False)
|
path = task.artifacts[self.model_endpoint.preprocess_artifact].get_local_copy(extract_archive=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user