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,
|
source_image: Image.Image,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> Image.Image:
|
) -> Image.Image:
|
||||||
pipe = CodeFormer(
|
pipe = CodeFormer().to(device)
|
||||||
dim_embd=512,
|
|
||||||
codebook_size=1024,
|
|
||||||
n_head=8,
|
|
||||||
n_layers=9,
|
|
||||||
connect_list=["32", "64", "128", "256"],
|
|
||||||
).to(device)
|
|
||||||
|
|
||||||
return pipe(source_image)
|
return pipe(source_image)
|
||||||
|
|
|
@ -2,6 +2,7 @@ from collections import Counter
|
||||||
from concurrent.futures import Future, ProcessPoolExecutor, ThreadPoolExecutor
|
from concurrent.futures import Future, ProcessPoolExecutor, ThreadPoolExecutor
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from multiprocessing import Value
|
from multiprocessing import Value
|
||||||
|
from traceback import format_exception
|
||||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from .params import DeviceParams
|
from .params import DeviceParams
|
||||||
|
@ -191,7 +192,7 @@ class DevicePoolExecutor:
|
||||||
f.result()
|
f.result()
|
||||||
logger.info("job %s finished successfully", key)
|
logger.info("job %s finished successfully", key)
|
||||||
except Exception as err:
|
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)
|
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