mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 04:10:20 +03:00
Update callbacks.py
Use ternary
This commit is contained in:
parent
e73c1a89bf
commit
cb4ae79e6a
|
@ -73,10 +73,7 @@ def pipes_with_nvtx_range(
|
|||
nlp, additional_pipe_functions: Optional[Dict[str, List[str]]]
|
||||
):
|
||||
for _, pipe in nlp.components:
|
||||
if additional_pipe_functions:
|
||||
extra_funcs = additional_pipe_functions.get(pipe.name, [])
|
||||
else:
|
||||
extra_funcs = []
|
||||
extra_funcs = additional_pipe_functions.get(pipe.name, []) if additional_pipe_functions else []
|
||||
|
||||
for name in DEFAULT_NVTX_ANNOTATABLE_PIPE_METHODS + extra_funcs:
|
||||
func = getattr(pipe, name, None)
|
||||
|
|
Loading…
Reference in New Issue
Block a user