mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 09:06:35 +00:00
Refactor constants management to use Pydantic BaseModel for configuration
- Replaced module-level path variables in constants.py with a structured Pydantic Config class. - Updated all relevant modules (train.py, augmentation.py, exports.py, dataset-visualiser.py, manual_run.py) to access paths through the new config structure. - Fixed bugs related to image processing and model saving. - Enhanced test infrastructure to accommodate the new configuration approach. This refactor improves code maintainability and clarity by centralizing configuration management.
This commit is contained in:
@@ -54,6 +54,6 @@ def test_empty_label_file(empty_label):
|
||||
|
||||
def test_constants_patch_uses_tmp(constants_patch, tmp_path):
|
||||
constants_patch(tmp_path)
|
||||
assert c.azaion.startswith(str(tmp_path))
|
||||
assert c.data_dir.startswith(str(tmp_path))
|
||||
assert c.CURRENT_ONNX_MODEL.startswith(str(tmp_path))
|
||||
assert c.config.azaion.startswith(str(tmp_path))
|
||||
assert c.config.data_dir.startswith(str(tmp_path))
|
||||
assert c.config.current_onnx_model.startswith(str(tmp_path))
|
||||
|
||||
Reference in New Issue
Block a user