mirror of
https://github.com/huggingface/transformers.git
synced 2026-10-29 01:06:24 +08:00
* Move CI to Python 3.11, with the version set in `.python-version` - `.python-version` is the single source of the CI Python version. - GitHub Actions workflows use `python-version-file: .python-version`. - The CPU CI images now build on a shared `docker/ci-base.dockerfile` via `docker/docker-bake.hcl`; the build workflows pass `PYTHON_VERSION` from `.python-version`. Same for the doc-builder image. - consistency image: `pypi-kenlm` doesn't build on 3.11, use `kenlm` (needs cmake). - `check_circleci_user` only runs shell, use `cimg/base:stable`. * fix(ci): harden GitHub Actions workflows (#49311) (#49312) fix(ci): harden workflow files flagged on #49311 Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com> * dev-ci * [test all] [build-ci-image] --------- Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
17 lines
1.0 KiB
Docker
17 lines
1.0 KiB
Docker
FROM ci-base
|
|
ARG REF=main
|
|
RUN apt-get update && apt-get install -y time git g++ cmake pkg-config make git-lfs
|
|
RUN uv pip install --no-cache-dir GitPython
|
|
RUN uv pip install --no-cache-dir --upgrade 'torch<=2.14.0' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu
|
|
RUN uv pip install --no-cache-dir kenlm
|
|
RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[quality,testing,torch-speech,vision]"
|
|
RUN git lfs install
|
|
|
|
# Use a custom patched pytest to force exit the process at the end, to avoid `Too long with no output (exceeded 10m0s): context deadline exceeded` (#40201)
|
|
RUN uv pip install --no-cache-dir git+https://github.com/ydshieh/pytest.git@8.4.1-ydshieh
|
|
RUN uv pip install --no-cache-dir pytest-random-order
|
|
RUN uv pip install --no-cache-dir 'transformers-ci[otel] @ git+https://github.com/huggingface/transformers-ci@main'
|
|
|
|
RUN uv pip uninstall transformers
|
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get autoremove && apt-get autoclean
|