Skip to content

Commit 1c3188f

Browse files
committed
another merge conflict, this will never end lol
2 parents 4f7d3ad + 4df2529 commit 1c3188f

File tree

856 files changed

+3816
-181267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

856 files changed

+3816
-181267
lines changed

.github/workflows/model_jobs.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,16 @@ jobs:
138138
- name: Run all tests on GPU
139139
working-directory: /transformers
140140
run: |
141-
PATCH_TESTING_METHODS_TO_COLLECT_OUTPUTS=yes _PATCHED_TESTING_METHODS_OUTPUT_DIR=/transformers/reports/${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports python3 -m pytest -rsfE -v --make-reports=${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports tests/${{ matrix.folders }}
141+
script -q -c "PATCH_TESTING_METHODS_TO_COLLECT_OUTPUTS=yes _PATCHED_TESTING_METHODS_OUTPUT_DIR=/transformers/reports/${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports python3 -m pytest -rsfE -v --make-reports=${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports tests/${{ matrix.folders }}" test_outputs.txt
142+
ls -la
143+
# Extract the exit code from the output file
144+
PYTEST_EXIT_CODE=$(tail -1 test_outputs.txt | grep "PYTEST_EXIT_CODE:" | cut -d: -f2)
145+
exit ${PYTEST_EXIT_CODE:-1}
142146
143147
- name: Failure short reports
144148
if: ${{ failure() }}
149+
# This step is only to show information on Github Actions log.
150+
# Always mark this step as successful, even if the report directory or the file `failures_short.txt` in it doesn't exist
145151
continue-on-error: true
146152
run: cat /transformers/reports/${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports/failures_short.txt
147153

@@ -151,6 +157,12 @@ jobs:
151157
run: |
152158
cat /transformers/reports/${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports/captured_info.txt
153159
160+
- name: Copy test_outputs.txt
161+
if: ${{ always() }}
162+
continue-on-error: true
163+
run: |
164+
cp /transformers/test_outputs.txt /transformers/reports/${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports
165+
154166
- name: "Test suite reports artifacts: ${{ env.machine_type }}_${{ inputs.report_name_prefix }}_${{ env.matrix_folders }}_test_reports"
155167
if: ${{ always() }}
156168
uses: actions/upload-artifact@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Explore the [Hub](https://huggingface.com/) today to find a model and use Transf
8080

8181
## Installation
8282

83-
Transformers works with Python 3.9+ [PyTorch](https://pytorch.org/get-started/locally/) 2.1+, [TensorFlow](https://www.tensorflow.org/install/pip) 2.6+, and [Flax](https://flax.readthedocs.io/en/latest/) 0.4.1+.
83+
Transformers works with Python 3.9+, and [PyTorch](https://pytorch.org/get-started/locally/) 2.1+.
8484

8585
Create and activate a virtual environment with [venv](https://docs.python.org/3/library/venv.html) or [uv](https://docs.astral.sh/uv/), a fast Rust-based Python package and project manager.
8686

conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
"test_mismatched_shapes_have_properly_initialized_weights",
6868
"test_matched_shapes_have_loaded_weights_when_some_mismatched_shapes_exist",
6969
"test_model_is_small",
70-
"test_tf_from_pt_safetensors",
71-
"test_flax_from_pt_safetensors",
7270
"ModelTest::test_pipeline_", # None of the pipeline tests from PipelineTesterMixin (of which XxxModelTest inherits from) are running on device
7371
"ModelTester::test_pipeline_",
7472
"/repo_utils/",

docker/consistency.dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ RUN apt-get update && apt-get install -y time git g++ pkg-config make git-lfs
66
ENV UV_PYTHON=/usr/local/bin/python
77
RUN pip install uv && uv pip install --no-cache-dir -U pip setuptools GitPython
88
RUN uv pip install --no-cache-dir --upgrade 'torch' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu
9-
# tensorflow pin matching setup.py
109
RUN uv pip install --no-cache-dir pypi-kenlm
11-
RUN uv pip install --no-cache-dir "tensorflow-cpu<2.16" "tf-keras<2.16"
12-
RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[flax,quality,testing,torch-speech,vision]"
10+
RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[quality,testing,torch-speech,vision]"
1311
RUN git lfs install
1412

1513
RUN uv pip uninstall transformers

docker/transformers-all-latest-gpu/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ RUN git clone https://github.com/huggingface/transformers && cd transformers &&
2626
# 1. Put several commands in a single `RUN` to avoid image/layer exporting issue. Could be revised in the future.
2727
# 2. Regarding `torch` part, We might need to specify proper versions for `torchvision` and `torchaudio`.
2828
# Currently, let's not bother to specify their versions explicitly (so installed with their latest release versions).
29-
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime] && [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile && echo torch=$VERSION && [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA && python3 -m pip uninstall -y tensorflow tensorflow_text tensorflow_probability
30-
31-
RUN python3 -m pip uninstall -y flax jax
29+
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime] && [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile && echo torch=$VERSION && [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA
3230

3331
RUN python3 -m pip install --no-cache-dir -U timm
3432

docker/transformers-gpu/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ RUN apt update && \
1515
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
1616
python3 -m pip install --no-cache-dir \
1717
jupyter \
18-
tensorflow \
1918
torch
2019
RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/kernels@main#egg=kernels
2120

docker/transformers-past-gpu/Dockerfile

Lines changed: 0 additions & 59 deletions
This file was deleted.

docker/transformers-pytorch-amd-gpu/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ RUN git clone https://github.com/huggingface/transformers && cd transformers &&
2323
# Install transformers
2424
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev-torch,testing,video,audio]
2525

26-
# Remove tensorflow and flax as they are no longer supported by transformers
27-
RUN python3 -m pip uninstall -y tensorflow flax
28-
2926
# When installing in editable mode, `transformers` is not recognized as a package.
3027
# this line must be added in order for python to be aware of transformers.
3128
RUN cd transformers && python3 setup.py develop

docker/transformers-pytorch-gpu/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ RUN [ ${#PYTORCH} -gt 0 ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch';
2525
RUN [ ${#TORCH_VISION} -gt 0 ] && VERSION='torchvision=='TORCH_VISION'.*' || VERSION='torchvision'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
2626
RUN [ ${#TORCH_AUDIO} -gt 0 ] && VERSION='torchaudio=='TORCH_AUDIO'.*' || VERSION='torchaudio'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
2727

28-
RUN python3 -m pip uninstall -y tensorflow flax
29-
3028
RUN python3 -m pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git pytesseract
3129
RUN python3 -m pip install -U "itsdangerous<2.1.0"
3230

docker/transformers-tensorflow-gpu/Dockerfile

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)