fix(custom_models): add __init__.py and custom_hooks stub; set PYTHONPATH in Dockerfile for mmengine imports
Browse files- Dockerfile +2 -1
- custom_models/__init__.py +1 -0
- custom_models/custom_hooks.py +10 -0
Dockerfile
CHANGED
|
@@ -10,7 +10,8 @@ ENV PIP_NO_CACHE_DIR=1 \
|
|
| 10 |
HF_HOME=/data/hf \
|
| 11 |
HF_CACHE_DIR=/data/hf-cache \
|
| 12 |
HUGGINGFACE_HUB_CACHE=/data/hf-cache \
|
| 13 |
-
MPLCONFIGDIR=/data/matplotlib
|
|
|
|
| 14 |
|
| 15 |
RUN mkdir -p /data/hf /data/hf-cache /data/matplotlib && chmod -R 777 /data
|
| 16 |
|
|
|
|
| 10 |
HF_HOME=/data/hf \
|
| 11 |
HF_CACHE_DIR=/data/hf-cache \
|
| 12 |
HUGGINGFACE_HUB_CACHE=/data/hf-cache \
|
| 13 |
+
MPLCONFIGDIR=/data/matplotlib \
|
| 14 |
+
PYTHONPATH=/app:/app/custom_models:$PYTHONPATH
|
| 15 |
|
| 16 |
RUN mkdir -p /data/hf /data/hf-cache /data/matplotlib && chmod -R 777 /data
|
| 17 |
|
custom_models/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Ensures this directory is treated as a Python package
|
custom_models/custom_hooks.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .progressive_loss_hook import ProgressiveLossHook, AdaptiveLossHook
|
| 2 |
+
from .nan_recovery_hook import NanRecoveryHook
|
| 3 |
+
|
| 4 |
+
# Provide named aliases expected by configs/register
|
| 5 |
+
class ChartTypeDistributionHook: ...
|
| 6 |
+
class SkipInvalidLossHook: ...
|
| 7 |
+
class RuntimeErrorHook: ...
|
| 8 |
+
class MissingImageReportHook: ...
|
| 9 |
+
class SkipBadSamplesHook: ...
|
| 10 |
+
class CompatibleCheckpointHook: ...
|