Utils¶
danling.runners.utils
¶
RunnerMode
¶
Bases: LowercaseStrEnum
RunnerMode is an enumeration of running modes.
Attributes:
| Name | Type | Description |
|---|---|---|
train |
Training mode. |
|
evaluate |
Evaluation mode. |
|
infer |
Inference mode. |
Source code in danling/runners/utils.py
| Python | |
|---|---|
40 41 42 43 44 45 46 47 48 49 50 51 52 | |
on_main_process
¶
Python
on_main_process(func)
Decorator to run func only on main process.
Source code in danling/runners/utils.py
| Python | |
|---|---|
144 145 146 147 148 149 150 151 152 153 154 155 | |
on_local_main_process
¶
Python
on_local_main_process(func)
Decorator to run func only on local main process.
Source code in danling/runners/utils.py
| Python | |
|---|---|
158 159 160 161 162 163 164 165 166 167 168 169 | |