Skip to content

Commit

Permalink
Merge branch 'main' into feature-disable-no-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianlim committed Mar 22, 2024
2 parents c8a0a86 + fadb053 commit 968d415
Show file tree
Hide file tree
Showing 229 changed files with 18,015 additions and 2,625 deletions.
8 changes: 4 additions & 4 deletions .circleci/create_circleci_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class CircleCIJob:
install_steps: List[str] = None
marker: Optional[str] = None
parallelism: Optional[int] = 1
pytest_num_workers: int = 8
pytest_num_workers: int = 12
pytest_options: Dict[str, Any] = None
resource_class: Optional[str] = "xlarge"
resource_class: Optional[str] = "2xlarge"
tests_to_run: Optional[List[str]] = None
working_directory: str = "~/transformers"
# This should be only used for doctest job!
Expand Down Expand Up @@ -317,7 +317,7 @@ def job_name(self):
"pip install -U --upgrade-strategy eager -e git+https://github.com/huggingface/accelerate@main#egg=accelerate",
],
parallelism=1,
pytest_num_workers=6,
pytest_num_workers=12,
)


Expand Down Expand Up @@ -353,7 +353,7 @@ def job_name(self):
"pip install -U --upgrade-strategy eager .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm,video]",
],
marker="is_pipeline_test",
pytest_num_workers=6,
pytest_num_workers=12,
)


Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:

latest-torch-deepspeed-docker:
name: "Latest PyTorch + DeepSpeed"
runs-on: ubuntu-22.04
runs-on: [intel-cpu, 8-cpu, ci]
steps:
- name: Cleanup disk
run: |
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
# Can't build 2 images in a single job `latest-torch-deepspeed-docker` (for `nvcr.io/nvidia`)
latest-torch-deepspeed-docker-for-push-ci-daily-build:
name: "Latest PyTorch + DeepSpeed (Push CI - Daily Build)"
runs-on: ubuntu-22.04
runs-on: [intel-cpu, 8-cpu, ci]
steps:
- name: Cleanup disk
run: |
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
name: "Doc builder"
# Push CI doesn't need this image
if: inputs.image_postfix != '-push-ci'
runs-on: ubuntu-22.04
runs-on: [intel-cpu, 8-cpu, ci]
steps:
-
name: Set up Docker Buildx
Expand All @@ -164,7 +164,7 @@ jobs:
name: "Latest PyTorch [dev]"
# Push CI doesn't need this image
if: inputs.image_postfix != '-push-ci'
runs-on: ubuntu-22.04
runs-on: [intel-cpu, 8-cpu, ci]
steps:
- name: Cleanup disk
run: |
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
name: "Latest TensorFlow [dev]"
# Push CI doesn't need this image
if: inputs.image_postfix != '-push-ci'
runs-on: ubuntu-22.04
runs-on: [intel-cpu, 8-cpu, ci]
steps:
-
name: Set up Docker Buildx
Expand Down
16 changes: 10 additions & 6 deletions README.md

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions README_de.md

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions README_es.md

Large diffs are not rendered by default.

398 changes: 201 additions & 197 deletions README_fr.md

Large diffs are not rendered by default.

260 changes: 132 additions & 128 deletions README_hd.md

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions README_ja.md

Large diffs are not rendered by default.

36 changes: 20 additions & 16 deletions README_ko.md

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions README_pt-br.md

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions README_ru.md

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions README_te.md

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions README_vi.md

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions README_zh-hans.md

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions README_zh-hant.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@
"test_tokenization",
"test_processor",
"test_processing",
"test_beam_constraints",
"test_configuration_utils",
"test_data_collator",
"test_trainer_callback",
"test_trainer_utils",
"test_feature_extraction",
"test_image_processing",
"test_image_processor",
"test_image_transforms",
"test_optimization",
"test_retrieval",
"test_config",
"test_from_pretrained_no_checkpoint",
Expand Down Expand Up @@ -62,6 +69,9 @@
"test_flax_from_pt_safetensors",
"ModelTest::test_pipeline_", # None of the pipeline tests from PipelineTesterMixin (of which XxxModelTest inherits from) are running on device
"ModelTester::test_pipeline_",
"/repo_utils/",
"/utils/",
"/tools/",
}

# allow having multiple repository checkouts and not needing to remember to rerun
Expand Down
21 changes: 5 additions & 16 deletions docker/transformers-all-latest-gpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SHELL ["sh", "-lc"]
# The following `ARG` are mainly used to specify the versions explicitly & directly in this docker file, and not meant
# to be used as arguments for docker build (so far).

ARG PYTORCH='2.2.0'
ARG PYTORCH='2.2.1'
# (not always a valid torch version)
ARG INTEL_TORCH_EXT='2.2.0'
# Example: `cu102`, `cu113`, etc.
Expand All @@ -23,21 +23,10 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip
ARG REF=main
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF

# During switch torch 2.2, we need to move (explicit) torch installation below but keep tf installation here.
# (otherwise we get `The runner has received a shutdown signal.` whose root cause is unknown but likely disk being full)
RUN python3 -m pip install --no-cache-dir -U tensorflow==2.13 protobuf==3.20.3 tensorflow_text tensorflow_probability

RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime]

# RUN python3 -m pip uninstall -y torch torchvision torchaudio && python3 -m pip install --no-cache-dir -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# TODO: Handle these in a python utility script
RUN [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile
RUN echo torch=$VERSION
# `torchvision` and `torchaudio` should be installed along with `torch`, especially for nightly build.
# Currently, let's just use their latest releases (when `torch` is installed with a release version)
# TODO: We might need to specify proper versions that work with a specific torch version (especially for past CI).
RUN [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA
# 1. Put several commands in a single `RUN` to avoid image/layer exporting issue. Could be revised in the future.
# 2. Regarding `torch` part, We might need to specify proper versions for `torchvision` and `torchaudio`.
# Currently, let's not bother to specify their versions explicitly (so installed with their latest release versions).
RUN python3 -m pip install --no-cache-dir -U tensorflow==2.13 protobuf==3.20.3 tensorflow_text tensorflow_probability && 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 --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA

RUN python3 -m pip uninstall -y flax jax

Expand Down
3 changes: 3 additions & 0 deletions docker/transformers-quantization-latest-gpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ RUN python3 -m pip install --no-cache-dir aqlm[gpu]==1.0.2
# Add autoawq for quantization testing
RUN python3 -m pip install --no-cache-dir https://github.com/casper-hansen/AutoAWQ/releases/download/v0.2.0/autoawq-0.2.0+cu118-cp38-cp38-linux_x86_64.whl

# Add quanto for quantization testing
RUN python3 -m pip install --no-cache-dir quanto

# When installing in editable mode, `transformers` is not recognized as a package.
# this line must be added in order for python to be aware of transformers.
RUN cd transformers && python3 setup.py develop
12 changes: 10 additions & 2 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
- local: custom_tools
title: Custom Tools and Prompts
- local: troubleshooting
title: Troubleshoot
title: Troubleshoot
- local: hf_quantizer
title: Contribute new quantization method
title: Developer guides
Expand Down Expand Up @@ -310,6 +310,8 @@
title: CodeGen
- local: model_doc/code_llama
title: CodeLlama
- local: model_doc/cohere
title: Cohere
- local: model_doc/convbert
title: ConvBERT
- local: model_doc/cpm
Expand Down Expand Up @@ -593,6 +595,8 @@
title: SegFormer
- local: model_doc/seggpt
title: SegGpt
- local: model_doc/superpoint
title: SuperPoint
- local: model_doc/swiftformer
title: SwiftFormer
- local: model_doc/swin
Expand Down Expand Up @@ -640,6 +644,8 @@
title: MMS
- local: model_doc/musicgen
title: MusicGen
- local: model_doc/musicgen_melody
title: MusicGen Melody
- local: model_doc/pop2piano
title: Pop2Piano
- local: model_doc/seamless_m4t
Expand Down Expand Up @@ -689,7 +695,7 @@
title: VideoMAE
- local: model_doc/vivit
title: ViViT
title: Video models
title: Video models
- isExpanded: false
sections:
- local: model_doc/align
Expand Down Expand Up @@ -742,6 +748,8 @@
title: LiLT
- local: model_doc/llava
title: Llava
- local: model_doc/llava_next
title: LLaVA-NeXT
- local: model_doc/lxmert
title: LXMERT
- local: model_doc/matcha
Expand Down
10 changes: 5 additions & 5 deletions docs/source/en/custom_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ seemingly giving the agent some kind of memory.
Let's take a closer look at how the prompt is structured to understand how it can be best customized.
The prompt is structured broadly into four parts.

- 1. Introduction: how the agent should behave, explanation of the concept of tools.
- 2. Description of all the tools. This is defined by a `<<all_tools>>` token that is dynamically replaced at runtime with the tools defined/chosen by the user.
- 3. A set of examples of tasks and their solution
- 4. Current example, and request for solution.
1. Introduction: how the agent should behave, explanation of the concept of tools.
2. Description of all the tools. This is defined by a `<<all_tools>>` token that is dynamically replaced at runtime with the tools defined/chosen by the user.
3. A set of examples of tasks and their solution
4. Current example, and request for solution.

To better understand each part, let's look at a shortened version of how the `run` prompt can look like:

Expand Down Expand Up @@ -301,7 +301,7 @@ and description and try refining your task request with it.
### Customizing the tool descriptions

As we've seen before the agent has access to each of the tools' names and descriptions. The base tools
should have very precise names and descriptions, however, you might find that it could help to change the
should have very precise names and descriptions, however, you might find that it could help to change
the description or name of a tool for your specific use case. This might become especially important
when you've added multiple tools that are very similar or if you want to use your agent only for a certain
domain, *e.g.* image generation and transformations.
Expand Down
4 changes: 4 additions & 0 deletions docs/source/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Flax), PyTorch, and/or TensorFlow.
| [CLVP](model_doc/clvp) ||||
| [CodeGen](model_doc/codegen) ||||
| [CodeLlama](model_doc/code_llama) ||||
| [Cohere](model_doc/cohere) ||||
| [Conditional DETR](model_doc/conditional_detr) ||||
| [ConvBERT](model_doc/convbert) ||||
| [ConvNeXT](model_doc/convnext) ||||
Expand Down Expand Up @@ -173,6 +174,7 @@ Flax), PyTorch, and/or TensorFlow.
| [LLaMA](model_doc/llama) ||||
| [Llama2](model_doc/llama2) ||||
| [LLaVa](model_doc/llava) ||||
| [LLaVA-NeXT](model_doc/llava_next) ||||
| [Longformer](model_doc/longformer) ||||
| [LongT5](model_doc/longt5) ||||
| [LUKE](model_doc/luke) ||||
Expand Down Expand Up @@ -206,6 +208,7 @@ Flax), PyTorch, and/or TensorFlow.
| [MRA](model_doc/mra) ||||
| [MT5](model_doc/mt5) ||||
| [MusicGen](model_doc/musicgen) ||||
| [MusicGen Melody](model_doc/musicgen_melody) ||||
| [MVP](model_doc/mvp) ||||
| [NAT](model_doc/nat) ||||
| [Nezha](model_doc/nezha) ||||
Expand Down Expand Up @@ -264,6 +267,7 @@ Flax), PyTorch, and/or TensorFlow.
| [SqueezeBERT](model_doc/squeezebert) ||||
| [StableLm](model_doc/stablelm) ||||
| [Starcoder2](model_doc/starcoder2) ||||
| [SuperPoint](model_doc/superpoint) ||||
| [SwiftFormer](model_doc/swiftformer) ||||
| [Swin Transformer](model_doc/swin) ||||
| [Swin Transformer V2](model_doc/swinv2) ||||
Expand Down
4 changes: 4 additions & 0 deletions docs/source/en/main_classes/quantization.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Learn how to quantize models in the [Quantization](../quantization) guide.

</Tip>

## QuantoConfig

[[autodoc]] QuantoConfig

## AqlmConfig

[[autodoc]] AqlmConfig
Expand Down
4 changes: 4 additions & 0 deletions docs/source/en/model_doc/auto.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ The following auto classes are available for the following computer vision tasks

[[autodoc]] AutoModelForVideoClassification

### AutoModelForKeypointDetection

[[autodoc]] AutoModelForKeypointDetection

### AutoModelForMaskedImageModeling

[[autodoc]] AutoModelForMaskedImageModeling
Expand Down
Loading

0 comments on commit 968d415

Please sign in to comment.