fix(api): log stacktrace from job errors
This commit is contained in:
parent
e059f11253
commit
bf1378bf96
|
@ -24,12 +24,6 @@ def correct_codeformer(
|
|||
source_image: Image.Image,
|
||||
**kwargs,
|
||||
) -> Image.Image:
|
||||
pipe = CodeFormer(
|
||||
dim_embd=512,
|
||||
codebook_size=1024,
|
||||
n_head=8,
|
||||
n_layers=9,
|
||||
connect_list=["32", "64", "128", "256"],
|
||||
).to(device)
|
||||
pipe = CodeFormer().to(device)
|
||||
|
||||
return pipe(source_image)
|
||||
|
|
|
@ -2,6 +2,7 @@ from collections import Counter
|
|||
from concurrent.futures import Future, ProcessPoolExecutor, ThreadPoolExecutor
|
||||
from logging import getLogger
|
||||
from multiprocessing import Value
|
||||
from traceback import format_exception
|
||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||
|
||||
from .params import DeviceParams
|
||||
|
@ -191,7 +192,7 @@ class DevicePoolExecutor:
|
|||
f.result()
|
||||
logger.info("job %s finished successfully", key)
|
||||
except Exception as err:
|
||||
logger.warn("job %s failed with an error: %s", key, err)
|
||||
logger.warn("job %s failed with an error: %s", key, format_exception(type(err), err, err.__traceback__))
|
||||
|
||||
future.add_done_callback(job_done)
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"stages": [
|
||||
{
|
||||
"name": "faces",
|
||||
"type": "correct-codeformer",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"name": "save-local",
|
||||
"type": "persist-disk",
|
||||
"params": {
|
||||
"tile_size": "hd8k"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue