Jayant-Kernel commited on
Commit ·
d75e720
1
Parent(s): 91f4c95
fix: copy data to multiple locations, fallback path for level2
Browse files- Dockerfile +5 -1
- train.py +4 -1
Dockerfile
CHANGED
|
@@ -12,9 +12,13 @@ RUN pip install --no-cache-dir torch transformers peft trl bitsandbytes accelera
|
|
| 12 |
|
| 13 |
RUN pip install --no-cache-dir git+https://github.com/Jayant-kernel/DECEIT-the-ai-truth-environment-.git
|
| 14 |
|
| 15 |
-
RUN mkdir -p /usr/local/lib/python3.10/site-packages/deceit_env/data/
|
|
|
|
|
|
|
| 16 |
|
| 17 |
COPY data/ /usr/local/lib/python3.10/site-packages/deceit_env/data/
|
|
|
|
|
|
|
| 18 |
COPY train.py .
|
| 19 |
|
| 20 |
CMD ["python", "train.py"]
|
|
|
|
| 12 |
|
| 13 |
RUN pip install --no-cache-dir git+https://github.com/Jayant-kernel/DECEIT-the-ai-truth-environment-.git
|
| 14 |
|
| 15 |
+
RUN mkdir -p /usr/local/lib/python3.10/site-packages/deceit_env/data/ && \
|
| 16 |
+
mkdir -p /home/trainer/.local/lib/python3.10/site-packages/deceit_env/data/ && \
|
| 17 |
+
mkdir -p /app/data/
|
| 18 |
|
| 19 |
COPY data/ /usr/local/lib/python3.10/site-packages/deceit_env/data/
|
| 20 |
+
COPY data/ /home/trainer/.local/lib/python3.10/site-packages/deceit_env/data/
|
| 21 |
+
COPY data/ /app/data/
|
| 22 |
COPY train.py .
|
| 23 |
|
| 24 |
CMD ["python", "train.py"]
|
train.py
CHANGED
|
@@ -202,7 +202,10 @@ print("Level 1 checkpoint saved locally")
|
|
| 202 |
# Load Level 2 dataset
|
| 203 |
import pathlib as _pl2
|
| 204 |
import deceit_env as _de2
|
| 205 |
-
|
|
|
|
|
|
|
|
|
|
| 206 |
questions_l2 = []
|
| 207 |
with open(data_path_l2) as f:
|
| 208 |
for line in f:
|
|
|
|
| 202 |
# Load Level 2 dataset
|
| 203 |
import pathlib as _pl2
|
| 204 |
import deceit_env as _de2
|
| 205 |
+
_de2_data = _pl2.Path(_de2.__file__).parent / "data" / "level2.jsonl"
|
| 206 |
+
_fallback = _pl2.Path("/app/data/level2.jsonl")
|
| 207 |
+
data_path_l2 = _de2_data if _de2_data.exists() else _fallback
|
| 208 |
+
print(f"Loading level2 from: {data_path_l2}")
|
| 209 |
questions_l2 = []
|
| 210 |
with open(data_path_l2) as f:
|
| 211 |
for line in f:
|