Skip to content

Commit 07fee49

Browse files
committed
fix: force CPU-only torch to avoid libcufft import error
1 parent 3cb91dd commit 07fee49

4 files changed

Lines changed: 62 additions & 319 deletions

File tree

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ghcr.io/lambda-feedback/evaluation-function-base/python:3.12 AS builder
22

3-
RUN pip install poetry==1.8.3
3+
RUN python -m pip install --no-cache-dir poetry==1.8.3
44

55
ENV POETRY_NO_INTERACTION=1 \
66
POETRY_VIRTUALENVS_IN_PROJECT=1 \
@@ -9,9 +9,14 @@ ENV POETRY_NO_INTERACTION=1 \
99

1010
COPY pyproject.toml poetry.lock ./
1111

12+
# Install deps (torch/torchvision will be resolved from pytorch-cpu source via pyproject.toml)
1213
RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
1314
poetry install --without dev --no-root
1415

16+
# Sanity check: ensure torch is CPU-only (cuda should be None)
17+
RUN python -c "import torch; print('torch', torch.__version__); print('torch.cuda', torch.version.cuda); print('cuda available', torch.cuda.is_available())"
18+
19+
1520
FROM ghcr.io/lambda-feedback/evaluation-function-base/python:3.12
1621

1722
ENV VIRTUAL_ENV=/app/.venv \
@@ -31,5 +36,6 @@ ENV FUNCTION_COMMAND="python"
3136
# Args to start the evaluation function with
3237
ENV FUNCTION_ARGS="-m,evaluation_function.main"
3338

39+
# Interface / logging
3440
ENV FUNCTION_INTERFACE="file"
35-
ENV LOG_LEVEL="debug"
41+
ENV LOG_LEVEL="debug"

evaluation_function/yolo_pipeline.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
import cv2
2020
import numpy as np
21-
#from ultralytics import YOLO
22-
YOLO = None
21+
from ultralytics import YOLO
2322

2423

2524
# =========================

0 commit comments

Comments
 (0)