Skip to content

Commit beef705

Browse files
committed
Update tmp_path with --basetmp (debug)
1 parent 4224bc7 commit beef705

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

.github/workflows/run-tests-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
uv pip install -r tests/requirements.txt
4747
4848
- name: Run Hugging Face DLCs Tests
49-
run: uv run pytest -s tests/
49+
run: uv run pytest -s tests/ --basetemp=${{ runner.temp }}
5050
env:
5151
TRAINING_DLC: ${{ inputs.training-dlc }}
5252
INFERENCE_DLC: ${{ inputs.inference-dlc }}

tests/pytorch/training/test_trl.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ def test_trl(caplog: pytest.LogCaptureFixture, tmp_path: PosixPath) -> None:
2121

2222
client = docker.from_env()
2323

24-
# Ensure that `tmp_path` exists and has right permissions
25-
tmp_path.mkdir(exist_ok=True)
26-
tmp_path.chmod(0o775)
27-
2824
logging.info("Running the container for TRL...")
2925
container = client.containers.run(
3026
os.getenv(
@@ -56,7 +52,7 @@ def test_trl(caplog: pytest.LogCaptureFixture, tmp_path: PosixPath) -> None:
5652
detach=True,
5753
# Mount the volume from the `tmp_path` to the `/opt/huggingface/trained_model`
5854
volumes={
59-
f"{tmp_path}/": {
55+
tmp_path: {
6056
"bind": "/opt/huggingface/trained_model",
6157
"mode": "rw",
6258
}
@@ -87,10 +83,6 @@ def test_trl_peft(caplog: pytest.LogCaptureFixture, tmp_path: PosixPath) -> None
8783

8884
client = docker.from_env()
8985

90-
# Ensure that `tmp_path` exists and has right permissions
91-
tmp_path.mkdir(exist_ok=True)
92-
tmp_path.chmod(0o775)
93-
9486
logging.info("Running the container for TRL...")
9587
container = client.containers.run(
9688
os.getenv(
@@ -125,7 +117,7 @@ def test_trl_peft(caplog: pytest.LogCaptureFixture, tmp_path: PosixPath) -> None
125117
detach=True,
126118
# Mount the volume from the `tmp_path` to the `/opt/huggingface/trained_model`
127119
volumes={
128-
f"{tmp_path}/": {
120+
tmp_path: {
129121
"bind": "/opt/huggingface/trained_model",
130122
"mode": "rw",
131123
}

0 commit comments

Comments
 (0)